/* Global Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    
    --accent-green: #22c55e;
    --accent-green-dim: rgba(34, 197, 94, 0.1);
    --accent-blue: #3b82f6;
    --accent-blue-dim: rgba(59, 130, 246, 0.1);
    --accent-red: #ef4444;
    --accent-red-dim: rgba(239, 68, 68, 0.1);
    --accent-gold: #fbbf24;
    --accent-gold-dim: rgba(251, 191, 36, 0.1);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: #f5f5f4;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Greeting Header */
.greeting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto 48px;
    padding: 0 8px;
}

.greeting-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
}

.greeting-header #username {
    color: var(--text-primary);
    font-weight: 600;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Circular for modern look */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 80px;
}

/* Main Header */
.main-header {
    text-align: center;
    margin-bottom: 64px;
}

.main-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

/* Alert Box */
.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-top: 32px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.alert-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent-gold);
    opacity: 0.9;
}

.alert-box p {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
}

/* Social Section */
.social-section {
    margin-bottom: 64px;
}

.section-subtitle {
    color: var(--text-tertiary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.social-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.social-left svg {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.social-btn:hover .social-left svg {
    color: var(--text-primary);
}

.social-left span {
    font-weight: 500;
    font-size: 15px;
}

.arrow-icon {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.2s, color 0.2s;
}

.social-btn:hover .arrow-icon {
    color: var(--text-primary);
    transform: translateX(4px);
}

/* Groups Section */
.groups-section {
    margin-bottom: 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.group-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 0;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    position: relative;
}

.private-group {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.05));
    border-color: rgba(59, 130, 246, 0.2);
}

.private-group:hover {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(59, 130, 246, 0.15);
}

.winners-group {
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.05), rgba(217, 119, 6, 0.05));
    border-color: rgba(251, 191, 36, 0.2);
}

.winners-group:hover {
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.1), rgba(217, 119, 6, 0.1));
    border-color: rgba(251, 191, 36, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(251, 191, 36, 0.15);
}

.group-card div {
    margin-bottom: 20px;
}

.group-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.group-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.group-card .arrow-icon {
    align-self: flex-end;
}

/* Plan Overview */
.plan-overview {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.plan-overview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue), var(--accent-red), var(--accent-gold), #a855f7);
    opacity: 0.8;
}

.plan-overview h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

.plan-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.plan-day h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-day:nth-child(1) h4 { color: var(--accent-green); }
.plan-day:nth-child(2) h4 { color: var(--accent-blue); }
.plan-day:nth-child(3) h4 { color: var(--accent-red); }
.plan-day:nth-child(4) h4 { color: var(--accent-gold); }
.plan-day:nth-child(5) h4 { color: #a855f7; }

.plan-day ul {
    list-style: none;
    padding-left: 0;
}

.plan-day ul li {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-left: 16px;
    position: relative;
}

.plan-day ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--text-tertiary);
}

/* Challenges Glass Card */
.challenges-glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 64px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.challenges-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue), var(--accent-red), var(--accent-gold), #a855f7);
    opacity: 0.8;
}

/* Day Selector Container */
.day-selector-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.day-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
    position: relative;
}

.day-selector:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.day-selector.active {
    background: var(--bg-card);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.day-selector[data-day="day1"].active {
    border-color: var(--accent-green);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.day-selector[data-day="day2"].active {
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.day-selector[data-day="day3"].active {
    border-color: var(--accent-red);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.day-selector[data-day="day4"].active {
    border-color: var(--accent-gold);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.day-selector[data-day="day5"].active {
    border-color: #a855f7;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

.day-number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.day-title {
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
}

/* Stages Content */
.stages-content {
    position: relative;
    min-height: 200px;
}

.day-stages {
    display: none;
    animation: fadeIn 0.3s ease;
}

.day-stages.active {
    display: block;
}

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


/* Stage Card */
.stage-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 28px;
    margin-bottom: 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.stage-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stage-info {
    flex: 1;
    padding-right: 20px;
}

.stage-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.stage-info p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.stage-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-details {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.stage-card:hover .view-details {
    color: var(--text-secondary);
}

.complete-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    color: transparent;
}

.complete-btn:hover {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.05);
}

.complete-btn.completed {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.complete-btn svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke-width: 3;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.complete-btn.completed svg {
    opacity: 1;
    transform: scale(1);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    backdrop-filter: blur(12px);
}

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

.toast-notification.hidden {
    display: none;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.toast-flag {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.toast-content p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.toast-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 4px;
}

.toast-close:hover {
    color: var(--text-primary);
    background: rgba(0,0,0,0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    /* Container adjustments */
    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 16px !important;
    }

    .greeting-header {
        margin-bottom: 32px;
        padding: 0 16px;
    }

    .main-header {
        margin-bottom: 32px;
        text-align: left;
    }

    .main-header h1 {
        font-size: 28px;
        margin-bottom: 16px;
        line-height: 1.2;
    }
    
    /* Alert box mobile */
    .alert-box {
        padding: 16px;
        margin-top: 24px;
        flex-direction: row;
        gap: 12px;
    }

    .alert-box svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .alert-box p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Groups section */
    .groups-section {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 32px;
    }

    .group-card {
        padding: 20px;
    }

    .group-card h3 {
        font-size: 16px;
    }

    .group-card p {
        font-size: 12px;
    }
    
    /* Plan overview */
    .plan-overview {
        padding: 24px 16px;
        margin-bottom: 24px;
    }

    .plan-overview h2 {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .plan-summary {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .plan-day h4 {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .plan-day ul li {
        font-size: 14px;
        margin-bottom: 8px;
    }

    /* Challenges glass card */
    .challenges-glass-card {
        padding: 16px;
        margin-bottom: 32px;
    }

    /* Day selector mobile */
    .day-selector-container {
        gap: 6px;
        margin-bottom: 20px;
        padding-bottom: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .day-selector-container::-webkit-scrollbar {
        display: none;
    }

    .day-selector {
        min-width: 80px;
        padding: 10px 12px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .day-number {
        font-size: 18px;
    }

    .day-title {
        font-size: 11px;
    }

    /* Stage cards */
    .stage-card {
        padding: 16px;
        margin-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .stage-info {
        width: 100%;
        padding-right: 0;
        margin-bottom: 0;
    }

    .stage-info h3 {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .stage-info p {
        font-size: 13px;
    }

    .stage-actions {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .view-details {
        font-size: 12px;
    }

    .complete-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    /* Toast notification */
    .toast-notification {
        right: 16px;
        left: 16px;
        bottom: 16px;
        max-width: none;
        padding: 12px 16px;
    }

    .toast-content {
        gap: 12px;
    }

    .toast-flag {
        font-size: 20px;
    }

    .toast-content p {
        font-size: 13px;
    }

    /* What You'll Learn grid mobile */
    .main-header ul[style*="grid-template-columns"],
    ul[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .main-header ul[style*="grid-template-columns"] li,
    ul[style*="grid-template-columns"] li {
        font-size: 0.875rem !important;
    }

    /* Inline style overrides for mobile */
    div[style*="padding-top: 32px"] {
        padding-top: 16px !important;
    }

    div[style*="padding-left: 20px"],
    div[style*="padding-right: 20px"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    div[style*="max-width: 900px"] {
        max-width: 100% !important;
    }

    h1[style*="margin-bottom: 1rem"] {
        margin-bottom: 0.75rem !important;
        font-size: 24px !important;
    }

    div[style*="font-size: 1rem"] {
        font-size: 0.9375rem !important;
        line-height: 1.6 !important;
    }

    div[style*="padding: 1rem"] {
        padding: 16px !important;
    }

    div[style*="margin-bottom: 1.5rem"] {
        margin-bottom: 1.25rem !important;
    }

    div[style*="margin-bottom: 2rem"] {
        margin-bottom: 1.5rem !important;
    }

    /* Hero section mobile */
    section[class*="h-[calc(100vh"] {
        min-height: auto !important;
        height: auto !important;
        padding-top: 24px !important;
        padding-bottom: 24px !important;
    }

    /* Large text mobile scaling */
    .text-6xl,
    .text-7xl,
    .text-8xl,
    .text-9xl {
        font-size: 2.5rem !important;
        line-height: 1.1 !important;
    }

    .text-5xl {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    .text-4xl {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }

    .text-3xl {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    /* Button improvements */
    button,
    .btn,
    a[class*="bg-"] {
        padding: 12px 20px !important;
        font-size: 16px !important;
    }

    /* Image responsiveness */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Prevent horizontal scroll */
    * {
        max-width: 100%;
    }

    /* Better spacing for lists */
    ul, ol {
        padding-left: 1.25rem;
    }

    /* Platform selection grid mobile */
    .grid[class*="grid-cols-2"][class*="md:grid-cols-4"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .grid[class*="grid-cols-2"][class*="md:grid-cols-4"] label {
        padding: 12px 8px !important;
        font-size: 12px !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .main-header h1 {
        font-size: 24px;
    }

    .plan-overview h2 {
        font-size: 18px;
    }

    .day-selector {
        min-width: 70px;
        padding: 8px 10px;
    }

    .day-number {
        font-size: 16px;
    }

    .day-title {
        font-size: 10px;
    }

    .stage-card {
        padding: 14px;
    }

    .group-card {
        padding: 16px;
    }
}

/* Touch target improvements */
@media (max-width: 768px) {
    button,
    a,
    .day-selector,
    .complete-btn,
    .stage-card {
        min-height: 44px;
        min-width: 44px;
    }

    input,
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    /* Form improvements */
    form {
        padding: 20px 16px !important;
    }

    form h3 {
        font-size: 16px !important;
        margin-bottom: 16px !important;
    }

    form label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }

    form input,
    form select,
    form textarea {
        padding: 12px 16px !important;
        font-size: 16px !important;
    }

    form button[type="submit"] {
        padding: 14px 20px !important;
        font-size: 16px !important;
        width: 100% !important;
    }

    /* Grid improvements */
    .grid[class*="grid-cols"] {
        grid-template-columns: 1fr !important;
    }

    /* Text size adjustments */
    h1 {
        font-size: 32px !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }

    /* Section padding */
    section {
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 32px !important;
        padding-bottom: 32px !important;
    }

    /* Card padding */
    .bg-white[class*="rounded"],
    .bg-white[class*="border"] {
        padding: 20px 16px !important;
    }

    /* Spacing adjustments */
    .space-y-6 > * + * {
        margin-top: 20px !important;
    }

    .space-y-4 > * + * {
        margin-top: 16px !important;
    }

    /* Benefits cards mobile */
    .grid[class*="md:grid-cols-3"] > div {
        padding: 20px 16px !important;
    }

    .grid[class*="md:grid-cols-3"] > div .text-3xl {
        font-size: 24px !important;
    }
}
