﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Glassmorphism Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
    z-index: -1;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header & Nav */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

/* â”€â”€â”€ Premium Navigation Bar â”€â”€â”€ */
.nav-menu {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow:
        0 4px 24px -4px rgba(0, 0, 0, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    position: relative;
}

.nav-link {
    position: relative;
    padding: 0.7rem 1.15rem;
    border-radius: 0.65rem;
    text-decoration: none;
    color: #64748b;
    font-weight: 550;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border: 1px solid transparent;
    z-index: 1;
}

.nav-link i {
    font-size: 0.9rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.nav-link:hover {
    background: rgba(241, 245, 249, 0.8);
    color: #1e293b;
    border-color: rgba(226, 232, 240, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.08);
}

.nav-link:hover i {
    transform: scale(1.12);
    opacity: 1;
}

.nav-link:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: none;
}

.nav-link.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border-color: transparent;
    box-shadow:
        0 4px 14px -3px rgba(79, 70, 229, 0.45),
        0 2px 6px -1px rgba(79, 70, 229, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.nav-link.active i {
    opacity: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 3px;
    border-radius: 3px;
    background: rgba(79, 70, 229, 0.5);
    filter: blur(2px);
}

/* â”€â”€â”€ Navigation separator dot for visual grouping â”€â”€â”€ */
.nav-separator {
    display: flex;
    align-items: center;
    padding: 0 0.15rem;
}

.nav-separator::before {
    content: '';
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
}

/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Tables */
.table-container {
    background: white;
    border-radius: 1.25rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.badge-todo {
    background: #fee2e2;
    color: #991b1b;
}

.badge-doing {
    background: #dbeafe;
    color: #1e40af;
}

.badge-done {
    background: #d1fae5;
    color: #065f46;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    transition: all 0.2s;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Login Page Specific */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-title {
    font-size: 1.875rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Image Gallery & Uploads */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--border-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-item:hover {
    transform: scale(1.02);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.4rem;
    font-size: 0.65rem;
    display: flex;
    justify-content: space-between;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.upload-zone i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    padding: 16px 24px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: #10b981;
    color: #059669;
}

.toast.success::before {
    content: 'âœ“';
    font-size: 20px;
    font-weight: bold;
    color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
    color: #dc2626;
}

.toast.error::before {
    content: 'âœ•';
    font-size: 20px;
    font-weight: bold;
    color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
    color: #d97706;
}

.toast.warning::before {
    content: 'âš ';
    font-size: 18px;
    color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
    color: #1d4ed8;
}

.toast.info::before {
    content: 'â„¹';
    font-size: 18px;
    font-weight: bold;
    color: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE DESIGN â€” Tablet & Mobile
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€â”€ Hamburger Toggle Button (shown via header.php JS) â”€â”€â”€ */
.nav-toggle {
    display: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* â”€â”€â”€ TABLET â€” max-width: 1024px â”€â”€â”€ */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* â”€â”€â”€ MOBILE â€” max-width: 768px â”€â”€â”€ */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.75rem;
    }

    /* Header */
    .header-inner {
        padding: 0 0.75rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    /* Hamburger menu visible */
    .nav-toggle {
        display: flex;
    }

    /* Nav menu becomes togglable dropdown overlay */
    .nav-menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 65px;
        left: 0.75rem;
        right: 0.75rem;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid rgba(226, 232, 240, 0.8);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
        border-radius: 1.5rem;
        padding: 0.85rem;
        gap: 0.4rem;
        z-index: 10000;
        max-height: 80vh;
        overflow-y: auto;
        animation: slideDownMenu 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideDownMenu {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-menu.open {
        display: flex !important;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-radius: 0.65rem;
    }

    .nav-separator {
        display: none;
    }

    /* Tables scroll horizontally */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    th,
    td {
        padding: 0.75rem 0.65rem;
        font-size: 0.8rem;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    /* Cards */
    .card {
        border-radius: 1rem;
        padding: 1rem;
    }

    /* Photo grid */
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }

    /* Toast */
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
    }

    .toast {
        min-width: auto;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* â”€â”€â”€ SMALL MOBILE â€” max-width: 480px â”€â”€â”€ */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem 0.5rem;
    }

    .header-inner {
        padding: 0 0.5rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    /* Stats single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Card */
    .card {
        padding: 0.875rem;
        border-radius: 0.875rem;
    }

    /* Login responsive */
    .login-card {
        margin: 1rem;
        padding: 1.75rem;
        max-width: 100%;
    }

    .login-title {
        font-size: 1.5rem;
    }

    /* Photo grid */
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ¦¦¦ Global Table To Card Stacking Utility ¦¦¦ */
@media (max-width: 768px) {
    .table-responsive-stack {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .table-responsive-stack table,
    .table-responsive-stack thead,
    .table-responsive-stack tbody,
    .table-responsive-stack th,
    .table-responsive-stack td,
    .table-responsive-stack tr {
        display: block !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .table-responsive-stack thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .table-responsive-stack tr {
        background: white !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 1.25rem !important;
        margin-bottom: 1.5rem !important;
        padding: 1.25rem !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    }

    .table-responsive-stack td {
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        position: relative !important;
        padding-left: 45% !important;
        text-align: left !important;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        width: 100% !important;
        white-space: normal !important;
    }

    .table-responsive-stack td:last-child {
        border-bottom: none !important;
    }

    .table-responsive-stack td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.025em;
    }
}