/* ===== Root Variables ===== */
:root {
    --primary: #9333ea;
    --primary-dark: #7e22ce;
    --primary-light: #a855f7;
    --secondary: #ec4899;
    --accent: #f97316;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --bg-light: #f8f7ff;
    --bg-dark: #1a1625;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Header ===== */
.app-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo-icon {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.avatar {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.logout-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: darken(var(--danger), 10%);
    transform: translateY(-2px);
}

/* ===== Main Content ===== */
.app-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== Auth Section ===== */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card > p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.auth-form input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-danger, .btn-link {
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    padding: 0.75rem 1.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--border);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-link {
    background: none;
    color: var(--primary);
    padding: 0;
    text-decoration: underline;
    font-weight: 500;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* ===== App Section ===== */
.app-section {
    animation: fadeIn 0.5s ease;
}

/* ===== Navigation Tabs ===== */
.app-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    padding-bottom: 0;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--primary);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-icon {
    font-size: 1.25rem;
}

/* ===== Tab Content ===== */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ===== Dashboard ===== */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    min-width: 3rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Celebration Message ===== */
.celebration-message {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 1.5rem;
    padding: 1.5rem;
    color: white;
    animation: slideDown 0.5s ease;
}

.celebration-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.celebration-emoji {
    font-size: 2.5rem;
    animation: bounce 1s infinite;
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
}

/* ===== Habits Section ===== */
.habits-section {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.habits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.habit-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.habit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: all 0.3s ease;
}

.habit-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.habit-card.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(34, 197, 94, 0.1));
    border-color: var(--success);
}

.habit-card.completed::before {
    background: linear-gradient(90deg, var(--success), #16a34a);
}

.habit-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.habit-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    flex: 1;
}

.habit-streak {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.habit-streak.active {
    animation: flicker 1s ease-in-out infinite;
}

.habit-category {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.habit-checkbox {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.checkbox-input {
    appearance: none;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-input:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.checkbox-input:checked {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    color: white;
    content: '✓';
}

.checkbox-input:checked::after {
    content: '✓';
}

.checkbox-label {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
}

.habit-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-light);
}

.habit-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.habit-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    font-size: 1.125rem;
}

/* ===== Statistics Grid ===== */
.statistics-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.stat-detail-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-detail-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
}

.stat-detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-detail-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
}

.stat-data {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-big-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-unit {
    font-size: 0.875rem;
    color: var(--text-light);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* ===== Partners Grid ===== */
.partners-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.partner-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.partner-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.partner-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.partner-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.partner-status {
    font-size: 0.875rem;
    color: var(--text-light);
}

.partner-progress {
    margin-bottom: 1.5rem;
}

.partner-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.partner-actions {
    display: flex;
    gap: 1rem;
}

.partner-actions button {
    flex: 1;
}

/* ===== Achievements Grid ===== */
.achievements-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.achievement-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 1.5rem;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: white;
}

.achievement-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shine 3s infinite;
}

.achievement-badge:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.achievement-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.achievement-date {
    font-size: 0.75rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.achievement-locked {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    opacity: 0.6;
    cursor: default;
}

.achievement-locked:hover {
    transform: none;
}

/* ===== Modals ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-confirm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-dark);
}

/* ===== Forms ===== */
.habit-form, .invite-form, .encouragement-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="time"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239333ea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    appearance: none;
}

.form-group.checkbox {
    flex-direction: row;
    align-items: center;
}

.form-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.form-group.checkbox input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.days-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.day-btn {
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.day-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.day-btn.selected {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.form-actions button {
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.modal-actions button {
    padding: 0.75rem 1.5rem;
}

.confirm-message {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.habit-details-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== Toast Notifications ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: slideInRight 0.3s ease;
    z-index: 2000;
    max-width: 300px;
    font-weight: 600;
}

.toast.show {
    display: block;
}

.toast.error {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.toast.success {
    background: linear-gradient(135deg, var(--success), #16a34a);
}

.toast.warning {
    background: linear-gradient(135deg, var(--warning), #ca8a04);
}

/* ===== Animations ===== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes flicker {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shine {
    0% {
        transform: translate(-100%, -100%) rotate(45deg);
    }
    100% {
        transform: translate(100%, 100%) rotate(45deg);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .app-main {
        padding: 1rem;
    }

    .app-nav {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .nav-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .tab-icon {
        font-size: 1rem;
    }

    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        font-size: 2rem;
        min-width: 2.5rem;
    }

    .habits-grid {
        grid-template-columns: 1fr;
    }

    .statistics-grid {
        grid-template-columns: 1fr;
    }

    .partners-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .header-content {
        padding: 1rem 1.5rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .user-menu-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .toast {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .app-header {
        position: relative;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo h1 {
        display: none;
    }

    .overview-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .app-nav {
        gap: 0;
        border-bottom: none;
        padding-bottom: 1rem;
    }

    .nav-tab {
        flex: 1;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.75rem 0.5rem;
        border: none;
        border-bottom: 2px solid var(--border);
    }

    .nav-tab.active {
        border-bottom-color: var(--primary);
    }

    .tab-icon {
        font-size: 1.25rem;
    }

    .user-menu-btn span:last-child {
        display: none;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }
}
