/* ============================================================
   WIDGETS SECTION - 10 Home Screen Widgets Showcase
   ============================================================ */

.widgets-section {
    padding: 120px 0;
    background: linear-gradient(180deg,
            var(--bg-primary, #000) 0%,
            rgba(99, 102, 241, 0.05) 50%,
            var(--bg-primary, #000) 100%);
    position: relative;
    overflow: hidden;
}

.widgets-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Ambient Glow */
.widgets-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
        rgba(99, 102, 241, 0.08) 0%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.widgets-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

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

.widgets-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary, #fff);
}

.widgets-header p {
    font-size: 1.1rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    max-width: 500px;
    margin: 0 auto;
}

/* Widgets Showcase Grid */
.widgets-showcase {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

.widgets-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .widgets-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .widgets-row {
        grid-template-columns: 1fr;
    }
}

/* Widget Card */
.widget-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.widget-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.15);
}

.widget-card.featured {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg,
            rgba(99, 102, 241, 0.08) 0%,
            rgba(168, 85, 247, 0.05) 100%);
}

.widget-card.featured:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.25);
}

/* NEW Badge */
.widget-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #6366F1, #A855F7);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.widget-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.95);
}

.widget-card p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

/* Widget Preview (iPhone-style widget mockup) */
.widget-preview {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.04) 100%);
    border-radius: 20px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* iOS Widget Corner Radius */
.widget-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 50%);
    pointer-events: none;
}

/* Tasks Widget */
.widget-tasks .widget-icon {
    width: 36px;
    height: 36px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #10B981;
    margin-bottom: 12px;
}

.widget-mini-tasks {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mini-task {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.mini-task:first-child {
    width: 60px;
}

.mini-task:last-child {
    width: 70px;
}

/* Progress Widget */
.widget-progress {
    padding: 20px;
}

.progress-ring {
    width: 70px;
    height: 70px;
    position: relative;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring .ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.progress-ring .ring-fill {
    fill: none;
    stroke: #10B981;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: #10B981;
}

/* Focus Timer Widget */
.widget-focus {
    gap: 8px;
}

.focus-timer-display {
    font-size: 1.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: white;
}

.focus-pills {
    display: flex;
    gap: 6px;
}

.focus-pills .pill {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

.focus-pills .pill.active {
    background: white;
    color: #111;
}

/* Mood Check-In Widget */
.widget-mood {
    gap: 12px;
}

.mood-buttons {
    display: flex;
    gap: 8px;
}

.mood-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.mood-btn:first-child {
    background: rgba(16, 185, 129, 0.2);
    transform: scale(1.1);
}

.mood-streak {
    font-size: 0.75rem;
    color: #F97316;
    font-weight: 600;
}

/* Insights Widget */
.widget-insights {
    gap: 4px;
}

.insights-score {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.score-num {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10B981, #60A5FA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-trend {
    font-size: 0.85rem;
    font-weight: 600;
    color: #10B981;
}

.insights-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Streak Widget */
.widget-streak {
    gap: 4px;
}

.streak-flame {
    font-size: 2rem;
    animation: flicker 1.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.streak-count {
    font-size: 1.8rem;
    font-weight: 800;
    color: #F97316;
}

.badges-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.badge {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Overdue Widget */
.widget-overdue {
    gap: 8px;
    background: linear-gradient(135deg,
            rgba(239, 68, 68, 0.1) 0%,
            rgba(255, 255, 255, 0.06) 100%);
}

.overdue-alert {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.overdue-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #EF4444;
}

/* BART Greeting Widget */
.widget-greeting {
    gap: 8px;
}

.bart-mini-face {
    width: 40px;
    height: 40px;
    background: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.mini-eyes {
    display: flex;
    gap: 6px;
}

.mini-eye {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: relative;
    transition: transform 0.1s ease;
}

.mini-eye::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #111;
    border-radius: 50%;
}

.greeting-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

/* Shortcuts Widget */
.widget-shortcuts {
    padding: 16px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.shortcut-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.widget-card:hover .shortcut-btn:first-child {
    background: rgba(99, 102, 241, 0.3);
}

/* Widget Features Bar */
.widgets-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    padding: 32px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.widget-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.widget-feature .feature-icon {
    font-size: 1.2rem;
}

/* Glass Panel Effect */
.glass-panel {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .widgets-section {
        padding: 80px 0;
    }

    .widgets-header {
        margin-bottom: 40px;
    }

    .widget-card {
        padding: 20px;
    }

    .widget-preview {
        height: 100px;
    }

    .widgets-features {
        gap: 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .focus-timer-display {
        font-size: 1.4rem;
    }

    .score-num {
        font-size: 2rem;
    }

    .streak-count {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .widget-badge {
        font-size: 0.6rem;
        padding: 3px 8px;
    }

    .mood-buttons {
        gap: 6px;
    }

    .mood-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
}

/* ============================================================
   ANIMATION ON SCROLL (GSAP will handle these)
   ============================================================ */

.widget-card.gsap-reveal {
    opacity: 0;
    transform: translateY(40px);
}

/* Fallback for no JS */
.no-js .widget-card {
    opacity: 1;
    transform: none;
}

/* Interactive hover animations */
.widget-card:hover .progress-ring .ring-fill {
    stroke-dasharray: 85, 100;
}

.widget-card:hover .focus-timer-display {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.widget-card:hover .score-num {
    transform: scale(1.05);
}

.widget-card:hover .streak-flame {
    animation: flicker 0.5s ease-in-out infinite alternate;
}

.widget-card:hover .bart-mini-face {
    transform: scale(1.1);
}

.widget-card:hover .mini-eye {
    animation: blink 0.3s ease;
}

@keyframes blink {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}
