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

:root {
    /* Color Palette - Techno-Indigo & Teal Accent */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-sidebar: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #f8fafc;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #e0e7ff;
    --teal-color: #0d9488;
    --teal-light: #ccfbf1;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --success-color: #10b981;
    --success-light: #d1fae5;
    
    /* Layout & Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font */
    --font-main: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --bg-primary: #090d16;
    --bg-secondary: #131926;
    --bg-sidebar: #090d16;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-light: #f8fafc;
    --accent-color: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: rgba(99, 102, 241, 0.15);
    --teal-color: #2dd4bf;
    --teal-light: rgba(45, 212, 191, 0.15);
    --danger-color: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    --warning-color: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --success-color: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
}

[data-theme="vocaloid"] {
    --bg-primary: #090e14;
    --bg-secondary: #0f1520;
    --bg-sidebar: #05080c;
    --text-primary: #e6f9f9;
    --text-secondary: #6e8fa0;
    --text-light: #e6f9f9;
    
    /* Miku Teal */
    --accent-color: #39C5BB; 
    --accent-hover: #ff5e7e; /* Teto Pink for hover */
    --accent-light: rgba(57, 197, 187, 0.12);
    
    /* Teto Pink */
    --warning-color: #ff5e7e;
    --warning-light: rgba(255, 94, 126, 0.12);
    
    --teal-color: #39C5BB;
    --teal-light: rgba(57, 197, 187, 0.12);
    
    --danger-color: #ff476d;
    --danger-light: rgba(255, 71, 109, 0.12);
    
    --success-color: #4df3c5;
    --success-light: rgba(77, 243, 197, 0.12);
    
    --shadow-sm: 0 1px 3px rgba(57, 197, 187, 0.1);
    --shadow-md: 0 4px 15px rgba(57, 197, 187, 0.15);
    --shadow-lg: 0 10px 25px rgba(255, 94, 126, 0.15);
}

/* Custom aesthetic touches for Vocaloid Edition */
[data-theme="vocaloid"] .sidebar-brand {
    color: #39C5BB !important;
    text-shadow: 0 0 10px rgba(57, 197, 187, 0.6);
    font-weight: 800;
}
[data-theme="vocaloid"] .sidebar-brand::after {
    content: " 🎛️ Miku & Teto Ed.";
    font-size: 0.65rem;
    color: #ff5e7e;
    display: block;
    text-shadow: 0 0 8px rgba(255, 94, 126, 0.6);
    letter-spacing: 1px;
}
[data-theme="vocaloid"] .sidebar-link.active {
    background-color: var(--accent-light);
    border-left: 4px solid var(--accent-color);
    color: var(--accent-color) !important;
}
[data-theme="vocaloid"] .header-title {
    text-shadow: 0 0 8px rgba(57, 197, 187, 0.3);
}
[data-theme="vocaloid"] .stat-card {
    border: 1px solid rgba(57, 197, 187, 0.1) !important;
}
[data-theme="vocaloid"] .card {
    border: 1px solid rgba(57, 197, 187, 0.08) !important;
}
[data-theme="vocaloid"] .table-custom tbody tr:hover {
    background-color: rgba(57, 197, 187, 0.04) !important;
}

/* Vocaloid Custom Web-safe Cursor Support */
[data-theme="vocaloid"], 
[data-theme="vocaloid"] * {
    cursor: url('../img/miku-cursor.cur'), url('../img/miku-cursor.png') 2 2, url('../img/miku-cursor.gif') 2 2, auto !important;
}
[data-theme="vocaloid"] a, 
[data-theme="vocaloid"] button, 
[data-theme="vocaloid"] .btn, 
[data-theme="vocaloid"] select, 
[data-theme="vocaloid"] input,
[data-theme="vocaloid"] .sidebar-link,
[data-theme="vocaloid"] .user-avatar {
    cursor: url('../img/miku-pointer.cur'), url('../img/miku-pointer.png') 12 2, url('../img/miku-pointer.gif') 12 2, pointer !important;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    transition: var(--transition);
}

/* Auth Layout (Login Screen) */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(13, 148, 136, 0.15) 0%, transparent 40%),
                var(--bg-primary);
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    transition: var(--transition);
}

[data-theme="dark"] .auth-card {
    background: rgba(19, 25, 38, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--teal-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* App Layout */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a5b4fc, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 14px;
    margin-bottom: 4px;
    padding-left: 16px;
}

.sidebar-heading:first-of-type {
    margin-top: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-link.active {
    background-color: var(--accent-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: var(--transition);
}

[data-theme="dark"] .header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.content-body {
    padding: 30px;
    flex: 1;
}

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

.stat-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

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

[data-theme="dark"] .stat-card {
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 700;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background-color: var(--accent-light); color: var(--accent-color); }
.stat-icon.success { background-color: var(--success-light); color: var(--success-color); }
.stat-icon.warning { background-color: var(--warning-light); color: var(--warning-color); }
.stat-icon.danger { background-color: var(--danger-light); color: var(--danger-color); }

/* Main layout grid for dashboard content */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

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

/* Card General */
.card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.02);
    margin-bottom: 24px;
    transition: var(--transition);
}

[data-theme="dark"] .card {
    border: 1px solid rgba(255,255,255,0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.table-custom th, .table-custom td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .table-custom th, [data-theme="dark"] .table-custom td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-custom th {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] .table-custom th {
    background-color: rgba(255, 255, 255, 0.01);
}

.table-custom tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] .table-custom tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success { background-color: var(--success-light); color: var(--success-color); }
.badge.warning { background-color: var(--warning-light); color: var(--warning-color); }
.badge.danger { background-color: var(--danger-light); color: var(--danger-color); }
.badge.primary { background-color: var(--accent-light); color: var(--accent-color); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-secondary {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background-color: var(--danger-color);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--border-radius-sm);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

[data-theme="dark"] .form-control {
    border-color: rgba(255, 255, 255, 0.1);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Theme Switcher */
.theme-switch {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-switch:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .theme-switch:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition);
    overflow: hidden;
}

.modal-content.modal-lg {
    max-width: 750px;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}


.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

[data-theme="dark"] .modal-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

/* User Info header component */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent-color);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { border-left-color: var(--success-color); }
.toast.danger { border-left-color: var(--danger-color); }
.toast.warning { border-left-color: var(--warning-color); }

/* Quick Action Row */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-wrapper {
    position: relative;
    max-width: 300px;
    width: 100%;
}

/* Custom Grid List */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Print Styling */
@media print {
    .sidebar, .header, .btn, .action-bar, .modal {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* Responsive fixes */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .header {
        padding: 0 16px;
    }
    .content-body {
        padding: 16px;
    }
    
    /* Stack action bars vertically on mobile */
    .action-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px;
    }
    .action-bar > div {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 8px;
    }
    .action-bar select, .action-bar button, .action-bar .search-wrapper, .action-bar a {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Make inline grids stack vertically inside modals */
    .modal-content div[style*="grid-template-columns"],
    .modal-content div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* Optimize padding and layout for smaller screens */
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    .modal-body {
        padding: 16px;
    }
    .modal-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.2rem;
    }
    .stat-card {
        padding: 16px;
    }
    .card {
        padding: 16px;
    }
}

/* Sidebar Dropdown Submenus */
.sidebar-submenu {
    list-style: none;
    padding-left: 40px;
    margin-top: 4px;
    display: none;
    flex-direction: column;
    gap: 6px;
    animation: submenuFade 0.25s ease forwards;
}

@keyframes submenuFade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-dropdown.active .sidebar-submenu {
    display: flex;
}

.submenu-link {
    display: block;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.submenu-link:hover, .submenu-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.sidebar-dropdown.active .arrow {
    transform: rotate(180deg);
}

/* Vocaloid Mascot and Loader Styling */
.vocaloid-sidebar-mascot {
    display: none;
    text-align: center;
    padding: 10px 0;
    margin-bottom: 5px;
}
[data-theme="vocaloid"] .vocaloid-sidebar-mascot {
    display: block;
}
.vocaloid-sidebar-mascot img {
    width: 90px;
    height: auto;
    border-radius: 12px;
    filter: drop-shadow(0 0 10px var(--accent-color));
    border: 2px solid rgba(57, 197, 187, 0.3);
}

/* Loader Overlay */
.vocaloid-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #05080c;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
    opacity: 1;
}
.vocaloid-loader-content {
    text-align: center;
}
.vocaloid-loader-content img {
    width: 180px;
    height: auto;
    border-radius: 20px;
    filter: drop-shadow(0 0 15px #39C5BB);
    margin-bottom: 20px;
}
.vocaloid-loader-text {
    color: #39C5BB;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(57, 197, 187, 0.8);
    animation: pulseText 1.5s infinite ease-in-out;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; text-shadow: 0 0 20px rgba(57, 197, 187, 1); }
}



