:root {
    --primary-color: #03045E;
    --secondary-color: #023E8A;
    --accent-color: #0077B6;
    --light-accent: #0096C7;
    --lightest-accent: #90E0EF;
    --white: #FFFFFF;
    --light-gray: #F8F9FA;
    --gray: #6C757D;
    --dark-gray: #343A40;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--lightest-accent) 0%, var(--light-accent) 100%);
    color: var(--dark-gray);
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}

header {
    background: var(--white);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.language-btn {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.language-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-card h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.welcome-card p {
    color: var(--gray);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.today-habits {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.today-habits h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.habit-item:hover {
    background: var(--lightest-accent);
}

.habit-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.habit-stack-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.habit-name {
    color: var(--gray);
    font-size: 0.9rem;
}

.habit-actions {
    display: flex;
    gap: 0.5rem;
}

.complete-btn {
    background: var(--success);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.complete-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.complete-btn.completed {
    background: var(--gray);
    cursor: not-allowed;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.primary-btn {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.primary-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.secondary-btn {
    background: var(--light-gray);
    color: var(--dark-gray);
    border: 2px solid var(--light-accent);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    background: var(--light-accent);
    color: var(--white);
    transform: translateY(-2px);
}

.stacks-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stack-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stack-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stack-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stack-title {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stack-description {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.stack-habits {
    list-style: none;
    margin-bottom: 1.5rem;
}

.stack-habits li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stack-habits li:last-child {
    border-bottom: none;
}

.stack-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.edit-btn, .delete-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-btn {
    background: var(--warning);
    color: var(--white);
}

.edit-btn:hover {
    background: #e0a800;
}

.delete-btn {
    background: var(--danger);
    color: var(--white);
}

.delete-btn:hover {
    background: #c82333;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--light-accent);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.modal-header h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--danger);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

#stack-form {
    padding: 1.5rem;
}

.habit-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.habit-input {
    flex: 1;
}

.remove-habit-btn {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.remove-habit-btn:hover {
    background: #c82333;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.progress-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.progress-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.chart-container {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chains-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chain-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.chain-days {
    display: flex;
    gap: 0.25rem;
}

.chain-day {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--light-gray);
    border: 2px solid var(--gray);
}

.chain-day.completed {
    background: var(--success);
    border-color: var(--success);
}

.insights-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.insights-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-item {
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.tips-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tip-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tip-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tip-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.tip-card p {
    color: var(--gray);
    line-height: 1.6;
}

.recovery-tools {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.recovery-tools h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.recovery-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quote-display {
    padding: 1.5rem;
    background: var(--lightest-accent);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
    margin-top: 1rem;
}

.quote-display.hidden {
    display: none;
}

.quote-display p {
    font-style: italic;
    color: var(--primary-color);
    font-size: 1.1rem;
    text-align: center;
}

.faq-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 2rem 0;
}

.faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: var(--light-gray);
    border: none;
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-gray);
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--lightest-accent);
}

.faq-question[aria-expanded="true"] {
    background: var(--accent-color);
    color: var(--white);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 1.5rem;
    background: var(--white);
    border-top: 1px solid var(--light-gray);
    animation: slideDown 0.3s ease-out;
}

.faq-answer[hidden] {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray);
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    min-width: 60px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-color);
    background: var(--lightest-accent);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray);
    font-size: 0.9rem;
    background: var(--white);
    margin-top: 3rem;
    border-top: 1px solid var(--light-gray);
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .stacks-list {
        grid-template-columns: 1fr;
    }
    
    .progress-cards {
        grid-template-columns: 1fr;
    }
    
    .tips-container {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .recovery-actions {
        flex-direction: column;
    }
    
    .habit-input-group {
        flex-direction: column;
    }
    
    .habit-input-group .remove-habit-btn {
        align-self: flex-end;
        width: auto;
    }
}

@media (max-width: 480px) {
    main {
        padding: 0.5rem;
    }
    
    .welcome-card,
    .today-habits,
    .stack-card,
    .progress-card,
    .tip-card,
    .recovery-tools,
    .faq-section {
        padding: 1.5rem;
    }
    
    .modal-content {
        margin: 0.5rem;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
}

.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.success-animation {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.error-shake {
    animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid #007bff;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left-color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-warning {
    border-left-color: #ffc107;
}

.toast-info {
    border-left-color: #17a2b8;
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast-message {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    line-height: 1;
}

.toast-close:hover {
    color: #333;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

.slide-down {
    animation: slideDown 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 200px;
        opacity: 1;
    }
}

/* Success and Error Animations */
.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

.error-shake {
    animation: errorShake 0.5s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Improved Modal Animations */
.modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Improved Button States */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Improved Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.success {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Improved Habit Items */
.habit-item {
    transition: all 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
}

.habit-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.habit-item.completed {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.habit-item.completed .habit-stack-name,
.habit-item.completed .habit-name {
    color: white;
}

/* Improved Stack Cards */
.stack-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.stack-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stack-card .stack-actions {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.stack-card:hover .stack-actions {
    opacity: 1;
}

/* Improved Progress Visualization */
.chain-day {
    transition: all 0.3s ease;
    border-radius: 4px;
}

.chain-day.completed {
    background: linear-gradient(135deg, #28a745, #20c997);
    transform: scale(1.1);
}

.chain-day:hover {
    transform: scale(1.2);
}

/* Improved Insights */
.insight-item {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
    transition: all 0.2s ease;
}

.insight-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.insight-item.success {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.insight-item.warning {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.insight-item.tip {
    border-left-color: #17a2b8;
    background: rgba(23, 162, 184, 0.1);
}

.insight-item.motivation {
    border-left-color: #e83e8c;
    background: rgba(232, 62, 140, 0.1);
}

/* Improved Navigation */
.nav-item {
    transition: all 0.2s ease;
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* Improved Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .toast {
        left: 20px;
        right: 20px;
        min-width: auto;
        max-width: none;
    }
    
    .stack-card:hover {
        transform: none;
    }
    
    .habit-item:hover {
        transform: none;
    }
    
    .nav-item::after {
        display: none;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.nav-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid #000;
    }
    
    .insight-item {
        border: 2px solid #000;
    }
    
    .chain-day.completed {
        border: 2px solid #000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .toast-message {
        color: #e2e8f0;
    }
    
    .toast-close {
        color: #a0aec0;
    }
    
    .toast-close:hover {
        color: #e2e8f0;
    }
    
    .insight-item {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Print Styles */
@media print {
    .toast,
    .modal,
    .nav-item::after,
    .btn {
        display: none !important;
    }
    
    .stack-card,
    .habit-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
