/* ==========================================================
   PROFESSIONAL PROJECT DASHBOARD — MAROON THEME (v2)
   ========================================================== */

/* ===== Global Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", "Segoe UI", sans-serif;
    transition: background 0.35s ease, color 0.35s ease, border 0.35s ease;
}

/* ===== Root Variables ===== */
:root {
    --maroon: #800000;
    --maroon-light: #c04c4c;
    --maroon-dark: #4b0000;
    --accent: #ffbaba;

    --light-bg: #f8f6f6;
    --light-card: #ffffffcc;
    --light-text: #1a1a1a;

    --dark-bg: #140a0a;
    --dark-card: #2a1414cc;
    --dark-text: #f5f5f5;

    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.5);
}

/* ===== Body (Dark Default) ===== */
body {
    background: radial-gradient(circle at top left, var(--maroon-dark), var(--dark-bg) 70%);
    color: var(--dark-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 40px;
    overflow-x: hidden;
    transition: background 0.4s ease;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 24px;
    font-size: 1.6rem;
    cursor: pointer;
    user-select: none;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 10px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 8px var(--shadow-dark);
    transition: transform 0.25s ease, background 0.3s ease, color 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* ===== Header ===== */
header {
    text-align: center;
    margin-bottom: 48px;
    width: 100%;
}

header h1 a {
    color: var(--maroon-light);
    text-decoration: none;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

header h1 a:hover {
    color: var(--accent);
    text-shadow: 0 0 14px var(--accent);
}

/* ===== Main Content ===== */
main {
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: center;
}

/* ===== Project List (Grid) ===== */
.project-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    width: 100%;
    max-width: 1100px;
    padding-bottom: 40px;
}

/* ===== Project Card ===== */
.project-list li {
    background: var(--dark-card);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 4px 16px var(--shadow-dark);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.25s ease, box-shadow 0.3s ease, border 0.3s ease;
}

.project-list li:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--maroon-light);
    box-shadow: 0 8px 20px var(--shadow-dark);
}

/* ===== Project Link ===== */
.project-list a {
    display: block;
    padding: 18px 22px;
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.project-list a:hover {
    color: var(--maroon-light);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: auto;
    color: var(--dark-text);
    padding: 20px;
    width: 100%;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== Light Mode ===== */
body.light-mode {
    background: radial-gradient(circle at top left, #fff1f1, var(--light-bg));
    color: var(--light-text);
}

body.light-mode .theme-toggle {
    color: var(--maroon-dark);
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 6px var(--shadow-light);
}

body.light-mode header h1 a {
    color: var(--maroon);
}

body.light-mode .project-list li {
    background: var(--light-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 3px 8px var(--shadow-light);
}

body.light-mode .project-list li:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--maroon);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

body.light-mode .project-list a {
    color: var(--light-text);
}

body.light-mode .project-list a:hover {
    color: var(--maroon-dark);
}

body.light-mode footer {
    color: var(--light-text);
}

/* ===== Fade-in Animation ===== */
.project-list li {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.project-list li:nth-child(odd) {
    animation-delay: 0.1s;
}

.project-list li:nth-child(even) {
    animation-delay: 0.2s;
}

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

/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */

/* ===== Large Desktop (1400px+) ===== */
@media (min-width: 1400px) {
    .project-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 26px;
        max-width: 1400px;
    }
    
    header h1 a {
        font-size: 2.6rem;
    }
}

/* ===== Desktop (1024px - 1399px) ===== */
@media (min-width: 1024px) and (max-width: 1399px) {
    body {
        padding: 36px 20px;
    }
    
    .project-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        max-width: 1200px;
    }
    
    header h1 a {
        font-size: 2.3rem;
    }
}

/* ===== Tablet Landscape (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    body {
        padding: 32px 18px;
    }
    
    header {
        margin-bottom: 40px;
    }
    
    header h1 a {
        font-size: 2.1rem;
    }
    
    .project-list {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 18px;
        max-width: 900px;
    }
    
    .project-list a {
        padding: 16px 20px;
        font-size: 0.98rem;
    }
    
    .theme-toggle {
        top: 18px;
        right: 20px;
        font-size: 1.5rem;
        padding: 9px;
    }
}

/* ===== Tablet Portrait (600px - 767px) ===== */
@media (min-width: 600px) and (max-width: 767px) {
    body {
        padding: 28px 16px;
    }
    
    header {
        margin-bottom: 36px;
    }
    
    header h1 a {
        font-size: 1.9rem;
    }
    
    .project-list {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
        max-width: 700px;
    }
    
    .project-list a {
        padding: 15px 18px;
        font-size: 0.96rem;
    }
    
    .theme-toggle {
        top: 16px;
        right: 18px;
        font-size: 1.45rem;
        padding: 8px;
    }
    
    footer {
        font-size: 0.88rem;
        padding: 18px;
    }
}

/* ===== Mobile (480px - 599px) ===== */
@media (min-width: 480px) and (max-width: 599px) {
    body {
        padding: 24px 14px;
    }
    
    header {
        margin-bottom: 32px;
    }
    
    header h1 a {
        font-size: 1.8rem;
        letter-spacing: 0.3px;
    }
    
    .project-list {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 14px;
    }
    
    .project-list a {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .project-list li:hover {
        transform: translateY(-4px) scale(1.015);
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        font-size: 1.4rem;
        padding: 8px;
    }
    
    footer {
        font-size: 0.86rem;
        padding: 16px;
    }
}

/* ===== Small Mobile (320px - 479px) ===== */
@media (max-width: 479px) {
    body {
        padding: 20px 12px;
    }
    
    header {
        margin-bottom: 28px;
    }
    
    header h1 a {
        font-size: 1.6rem;
        letter-spacing: 0.2px;
    }
    
    .project-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .project-list a {
        padding: 14px;
        font-size: 0.94rem;
    }
    
    .project-list li:hover {
        transform: translateY(-3px) scale(1.01);
    }
    
    .theme-toggle {
        top: 14px;
        right: 14px;
        font-size: 1.35rem;
        padding: 7px;
    }
    
    .theme-toggle:hover {
        transform: rotate(15deg) scale(1.08);
    }
    
    footer {
        font-size: 0.84rem;
        padding: 14px;
    }
}

/* ===== Extra Small Mobile (< 320px) ===== */
@media (max-width: 319px) {
    body {
        padding: 16px 10px;
    }
    
    header {
        margin-bottom: 24px;
    }
    
    header h1 a {
        font-size: 1.4rem;
        letter-spacing: 0.1px;
    }
    
    .project-list {
        gap: 10px;
    }
    
    .project-list a {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .theme-toggle {
        top: 12px;
        right: 12px;
        font-size: 1.3rem;
        padding: 6px;
    }
    
    footer {
        font-size: 0.82rem;
        padding: 12px;
    }
}

/* ===== Smooth Scrolling ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Landscape Orientation Adjustments ===== */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 16px 20px;
    }
    
    header {
        margin-bottom: 24px;
    }
    
    header h1 a {
        font-size: 1.6rem;
    }
    
    .project-list {
        gap: 14px;
        padding-bottom: 20px;
    }
    
    .project-list a {
        padding: 12px 16px;
    }
    
    footer {
        padding: 12px;
    }
}