/* =========================================
   BASE STYLES (Do not modify this section)
   ========================================= */
:root {
    --primary: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--light);
}

h1 { border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 30px; }
section { margin-bottom: 50px; }

.concept-card {
    background: white;
    border-left: 5px solid var(--primary);
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

code { background-color: #eee; padding: 2px 5px; border-radius: 4px; color: #d63384; font-size: 0.9em; }

.task-container {
    background: #fff;
    border: 2px dashed #cbd5e1;
    padding: 25px;
    border-radius: 8px;
    position: relative;
}

.task-badge {
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--dark);
    color: white;
    padding: 5px 15px;
    font-weight: bold;
    border-radius: 20px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* Helper for Bootstrap Visuals */
.demo-box {
    background-color: #e0e7ff;
    border: 1px solid #6366f1;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    color: #312e81;
    margin-bottom: 10px;
}

/* =========================================
   STUDENT WORKSPACE
   Complete the TODOs below.
   ========================================= */

/* --- TASK 1: RESPONSIVE DESIGN & BOOTSTRAP --- */

/* 1.1 Custom Media Query */
.mobile-alert {
    display: none; /* Hidden by default on Desktop */
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    text-align: center;
    border: 1px solid #f87171;
    margin-bottom: 10px;
}

/* TODO 1.1: Write a Media Query for Mobile */
@media (max-width: 576px) {
    .mobile-alert {
        display: block;
    }
}

/* 1.2 Flexbox Responsive Menu */
.nav-menu {
    list-style: none; padding: 0; margin: 0;
    background-color: var(--dark);
    display: flex; /* Flex row by default */
    justify-content: space-around;
}
.nav-menu li a { display: block; padding: 15px; color: white; text-decoration: none; }

/* TODO 1.2: Stack Menu Vertically on Mobile */
@media (max-width: 600px) {
    .nav-menu {
        flex-direction: column;
    }
    .nav-menu li {
        border-bottom: 1px solid #fff;
    }
    .nav-menu li:last-child {
        border-bottom: none;
    }
}

/* 1.5 Device Breakpoints (NEW) */
.device-box {
    background-color: #e2e8f0; /* Default (Mobile) */
    padding: 20px;
    text-align: center;
    border: 2px solid #94a3b8;
    margin-bottom: 10px;
    font-weight: bold;
    color: #475569;
}

/* TODO 1.5: Tablet & Desktop Breakpoints */
@media (min-width: 768px) {
    .device-box {
        background-color: yellow;
    }
}
@media (min-width: 992px) {
    .device-box {
        background-color: green;
    }
}

/* 1.6 Screen Orientation */
.landscape-box {
    background-color: #ffddd7;
    color: #881337;
    padding: 15px;
    text-align: center;
    border: 2px dashed #fb7185;
    display: none; /* Hidden by default (Portrait) */
    font-weight: bold;
}

/* TODO 1.6: Orientation Media Query */
@media (orientation: landscape) {
    .landscape-box {
        display: block;
    }
}

/* --- TASK 2: ACCESSIBILITY --- */

.btn-accessible {
    /* TODO 2.1: Fix Contrast */
    background-color: #0d6efd; 
    color: white; border: none; padding: 10px 20px;
    font-size: 1rem; cursor: pointer; border-radius: 4px;
}

/* TODO 2.2: Add Focus State */
.btn-accessible:focus {
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

/* --- TASK 3: ANIMATION --- */

/* 3.1 Hover Transition */
.anim-card {
    background: white; border: 1px solid #ddd; padding: 20px;
    width: 150px; text-align: center; cursor: pointer;
    transition: transform 0.3s ease;
}
.anim-card:hover {
    transform: scale(1.1);
}

/* 3.2 Loading Spinner Keyframes */
.spinner {
    width: 40px; height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* TODO 3.2: Define Keyframes */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* TODO 3.4: Pulse Animation */
.pulse-circle {
    width: 30px; height: 30px; background-color: red; border-radius: 50%;
    animation: pulse 1s infinite alternate;
}
@keyframes pulse {
    0% { opacity: 1; }
    100% { opacity: 0.5; }
}
