@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Academic Colors */
    --primary: #1d4ed8; /* Royal Blue */
    --primary-light: #3b82f6; /* Accent Blue */
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --secondary: #0f172a; /* Slate / Dark Slate */
    --accent: #d97706; /* Gold / Amber */
    --accent-gradient: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    --success: #10b981; /* Emerald */
    --success-gradient: linear-gradient(135deg, #047857 0%, #10b981 100%);
    
    /* Backgrounds & Panels */
    --bg-main: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 1rem; /* Standard institutional look */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Sarabun', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Beautiful Slim Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}



.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.logo i {
    font-size: 1.6rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(29, 78, 216, 0.2));
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Academic Tab Menu (used on dashboard) */
.nav-menu {
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    gap: 0.25rem;
}



.nav-menu .btn {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-main) !important;
    box-shadow: none !important;
    border: none !important;
    transition: all 0.2s ease;
}

.nav-menu .btn i {
    font-size: 1rem;
    color: var(--text-muted) !important;
}

.nav-menu .btn:hover {
    background: var(--bg-card) !important;
    color: var(--primary) !important;
    transform: translateY(0) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

.nav-menu .btn:hover i {
    color: var(--primary) !important;
}

/* Call-to-action tab (e.g. Add performance) */
.nav-menu .btn-primary {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(29, 78, 216, 0.2) !important;
}

.nav-menu .btn-primary i {
    color: white !important;
}

.nav-menu .btn-primary:hover {
    background: #1e40af !important;
    color: white !important;
    box-shadow: 0 6px 10px rgba(29, 78, 216, 0.3) !important;
}

/* Mobile responsive menu */
@media (max-width: 992px) {
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.25rem;
        margin-top: 1rem;
    }
    .nav-menu .btn {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
    nav {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Standard Buttons & Micro-interactions */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white !important;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.35);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main) !important;
    box-shadow: var(--shadow);
}

.btn-outline i {
    color: var(--primary) !important;
}

.btn-outline:hover {
    background: var(--primary);
    color: white !important;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.15);
}

.btn-outline:hover i {
    color: white !important;
}

/* Specific nav button variations */
.btn-project { border-color: rgba(99, 102, 241, 0.3); }
.btn-project i { color: #6366f1 !important; }
.btn-project:hover { background: #6366f1; border-color: #6366f1; }

.btn-types { border-color: rgba(100, 116, 139, 0.3); }
.btn-types i { color: #64748b !important; }
.btn-types:hover { background: #64748b; border-color: #64748b; }

.btn-settings { border-color: rgba(71, 85, 105, 0.3); }
.btn-settings i { color: #475569 !important; }
.btn-settings:hover { background: #475569; border-color: #475569; }

.btn-logout { border-color: rgba(239, 68, 68, 0.3); }
.btn-logout i { color: #ef4444 !important; }
.btn-logout:hover { background: #ef4444; border-color: #ef4444; }

.btn-portfolio { border-color: rgba(217, 119, 6, 0.3); }
.btn-portfolio i { color: var(--accent) !important; }
.btn-portfolio:hover { background: var(--accent); border-color: var(--accent); }

/* Dashboard Cards & Layout */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

/* Lift on hover with high-end shadow and outline glow */
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(29, 78, 216, 0.25);
}

.card-img-container {
    position: relative;
    height: 150px;
    overflow: hidden;
    background: #f1f5f9;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img {
    transform: scale(1.06);
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(29, 78, 216, 0.08);
    color: var(--primary);
    border: 1px solid rgba(29, 78, 216, 0.15);
}

/* Specific tags coloring */
.card-tag.internal { background: rgba(99, 102, 241, 0.08); color: #6366f1; border-color: rgba(99, 102, 241, 0.15); }
.card-tag.external { background: rgba(29, 78, 216, 0.08); color: #1d4ed8; border-color: rgba(29, 78, 216, 0.15); }
.card-tag.honor { background: rgba(217, 119, 6, 0.08); color: #d97706; border-color: rgba(217, 119, 6, 0.15); }
.card-tag.seminar { background: rgba(16, 185, 129, 0.08); color: #10b981; border-color: rgba(16, 185, 129, 0.15); }

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.card-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.card-info i {
    width: 16px;
    color: var(--primary-light);
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

/* Stat color theme overrides */
.stat-card.blue::after { background: var(--primary-light); }
.stat-card.rose::after { background: #ec4899; }
.stat-card.emerald::after { background: var(--success); }
.stat-card.amber::after { background: var(--accent); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

/* Accent coloring for values */
.stat-card.rose .stat-value { color: #db2777; }
.stat-card.amber .stat-value { color: var(--accent); }
.stat-card.blue .stat-value { color: var(--primary); }
.stat-card.emerald .stat-value { color: #059669; }

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.1);
}

/* Drag & Drop Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f8fafc;
}



.dropzone:hover {
    border-color: var(--primary);
    background: rgba(29, 78, 216, 0.02);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.preview-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sidebar Layout Structure */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.sidebar-logo i {
    font-size: 1.5rem;
    color: var(--primary);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    width: 100%;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.25rem;
    border-radius: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.925rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.sidebar-menu a i {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.25s ease;
    width: 20px;
    text-align: center;
}

.sidebar-menu a:hover {
    background: rgba(29, 78, 216, 0.05);
    color: var(--primary);
}

.sidebar-menu a:hover i {
    color: var(--primary);
}

/* Active State layout */
.sidebar-menu a.active {
    background: var(--primary-gradient);
    color: white !important;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
}

.sidebar-menu a.active i {
    color: white !important;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    max-width: calc(100% - 280px);
}

/* Mobile responsive menu */
@media (max-width: 992px) {
    .app-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1.5rem;
        height: auto;
        bottom: auto;
        gap: 1.5rem;
        box-shadow: var(--shadow);
    }
    .sidebar-logo {
        border-bottom: none;
        padding-bottom: 0;
    }
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        overflow-y: visible;
    }
    .sidebar-menu li {
        width: auto;
    }
    .sidebar-menu a {
        padding: 0.6rem 1rem;
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        max-width: 100%;
    }
}

/* Responsive Grid and Mobile Adjustments */
@media (max-width: 768px) {
    .container { padding: 1.5rem 1rem; }
    .btn { padding: 0.6rem 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .gallery { grid-template-columns: 1fr; }
}

/* Custom premium certification cards */
.card-category {
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.card-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #64748b;
    margin: 0 0 1.25rem 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(254, 226, 226, 0.9);
    backdrop-filter: blur(4px);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-delete-btn:hover {
    background: #dc2626;
    color: white;
    transform: scale(1.1);
}

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1d4ed8;
    color: white !important;
    font-weight: 500;
    font-size: 0.82rem;
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(29, 78, 216, 0.15);
    align-self: flex-start;
}

.card-btn:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 6px 10px rgba(29, 78, 216, 0.25);
}

@media print {
    .no-print { display: none !important; }
    body { background: white; color: black; }
    .container { max-width: 100%; padding: 0; }
    .card { border: 1px solid #e2e8f0; box-shadow: none; break-inside: avoid; }
}
