/* 
 * Stile Portale Questionari - X-Hosting Provider
 * CSS principale con design professionale
 */

/* Variabili CSS */
:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --dark-color: #000000;
    --succes-message: #ffffff;
    --gray-100: #0000007d;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--gray-100);
    color: var(--succes-message);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================
   LOGIN PAGE - Design Professionale
   ========================================== */

.login-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    overflow: hidden;
}

.login-background .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.shape.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary-color);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.shape.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary-color);
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.shape.shape-3 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 30px) scale(1.02);
    }
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particle-float 15s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Brand Section */
.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.brand-logo {
    margin-bottom: 15px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.brand-name {
    font-size: 26px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.brand-tagline {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Login Card */
.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    backdrop-filter: blur(10px);
}

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

.login-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    color: var(--danger-color);
    margin-bottom: 24px;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Login Form */
.login-form .form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.input-icon {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--gray-100);
    color: var(--dark-color);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:hover {
    border-color: var(--gray-300);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Password Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-400);
    transition: var(--transition-fast);
}

.toggle-password:hover {
    color: var(--gray-600);
}

.eye-icon {
    width: 22px;
    height: 22px;
}

.eye-icon.hidden {
    display: none;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--gray-600);
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remember-me input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: var(--primary-color);
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.btn-login:hover .btn-arrow {
    transform: translateX(4px);
}

/* Login Footer */
.login-footer {
    margin-top: 30px;
    text-align: center;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 12px;
}

.security-note svg {
    width: 16px;
    height: 16px;
}

.copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* ==========================================
   ADMIN LAYOUT (Dashboard, Sidebar, etc.)
   ========================================== */

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Sidebar e Navbar per Admin */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: var(--white);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 30px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
}

.sidebar-header h2 {
    font-size: 22px;
    margin-bottom: 4px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header p {
    font-size: 11px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--white);
    border-left-color: var(--primary-color);
}

.sidebar-menu li a i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    background: var(--gray-100);
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
}

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

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-card .icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .label {
    color: var(--gray-500);
    margin-top: 6px;
    font-size: 14px;
    font-weight: 500;
}

/* Tabelle */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr {
    transition: var(--transition-fast);
}

table tbody tr:hover {
    background: var(--gray-100);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.d-flex {
    display: flex;
}

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.align-center {
    align-items: center;
}

/* Checkbox e Radio personalizzati */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Pulsanti */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
    color: var(--white);
}

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

.btn-danger:hover {
    background: #dc2626;
    color: var(--white);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #d97706;
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-500);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-600);
    color: var(--white);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px 10px;
}

.btn + .btn {
    margin-left: 8px;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Alert */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
    font-size: 14px;
}

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

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition-fast);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--danger-color);
}

.modal-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Link condivisione */
.share-link-container {
    background: var(--gray-100);
    padding: 14px;
    border-radius: var(--radius);
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-link-container input {
    flex: 1;
    background: var(--white);
}

/* Griglia azioni */
.actions-cell {
    display: flex;
    gap: 6px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state .icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--gray-600);
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
}

/* Detail view */
.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    color: var(--primary-color);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
    font-size: 16px;
    font-weight: 600;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-label {
    font-weight: 500;
    width: 160px;
    flex-shrink: 0;
    color: var(--gray-600);
    font-size: 14px;
}

.detail-value {
    flex: 1;
    color: var(--dark-color);
}

/* Form builder */
.question-item {
    background: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.question-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

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

.question-number {
    font-weight: 600;
    color: var(--primary-color);
}

.question-type {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 12px;
    font-weight: 500;
}

/* Drag handle */
.drag-handle {
    cursor: move;
    color: var(--gray-400);
    margin-right: 10px;
    transition: var(--transition-fast);
}

.drag-handle:hover {
    color: var(--primary-color);
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.justify-between { justify-content: space-between; }

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

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        transform: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .table-container {
        font-size: 14px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .login-card {
        padding: 30px 24px;
    }
    
    .brand-name {
        font-size: 22px;
    }
    
    .login-header h2 {
        font-size: 20px;
    }
    
    .shape.shape-1 {
        width: 400px;
        height: 400px;
    }
    
    .shape.shape-2 {
        width: 350px;
        height: 350px;
    }
    
    .shape.shape-3 {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: 24px 20px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .btn-login {
        padding: 14px 20px;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-label {
        width: 100%;
        margin-bottom: 4px;
    }
}

/* Animazioni aggiuntive */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Focus styles per accessibilità */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
/* ==========================================
   DARK THEME DASHBOARD - Glassmorphism
   ========================================== */

/* Dashboard Dark Background */
.dashboard-dark {
    background: #0f172a;
}

.dashboard-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.bg-gradient-1 {
    width: 600px;
    height: 600px;
    background: var(--primary-color);
    top: -200px;
    left: -100px;
    animation: bg-float 15s infinite ease-in-out;
}

.bg-gradient-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary-color);
    bottom: -150px;
    right: -100px;
    animation: bg-float 20s infinite ease-in-out reverse;
}

.bg-gradient-3 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: bg-float 18s infinite ease-in-out;
}

@keyframes bg-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* Dark Sidebar */
.sidebar-dark {
    width: 280px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--white);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header-dark {
    padding: 28px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-logo {
    margin-bottom: 12px;
}

.logo-icon-small {
    width: 48px;
    height: 48px;
}

.sidebar-header-dark h2 {
    font-size: 20px;
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--white);
}

.sidebar-header-dark p {
    font-size: 10px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-list {
    list-style: none;
    padding: 0 12px;
}

.nav-list li {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: var(--white);
    border-left: 3px solid var(--primary-color);
}

.nav-link.logout {
    color: rgba(239, 68, 68, 0.7);
}

.nav-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 16px 12px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.user-role {
    font-size: 11px;
    color: var(--gray-400);
}

/* Main Content Dark */
.main-content-dark {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    background: transparent;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.breadcrumb-item {
    color: var(--gray-400);
}

.breadcrumb-item.active {
    color: var(--white);
    font-weight: 500;
}

.breadcrumb-separator {
    width: 16px;
    height: 16px;
    color: var(--gray-500);
}

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

.header-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger-color);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-300);
}

.header-date svg {
    width: 16px;
    height: 16px;
}

/* Page Header Dark */
.page-header-dark {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.welcome-section h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.welcome-section p {
    color: var(--gray-400);
    font-size: 15px;
}

.header-buttons {
    display: flex;
    gap: 12px;
}

/* Glass Buttons */
.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-glass svg {
    width: 18px;
    height: 18px;
}

.btn-glass-success {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

.btn-glass-success:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
    border-color: rgba(99, 102, 241, 0.5);
}

.btn-glass-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Glass Stats Cards */
.stat-card-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.stat-card-glass:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-card-glass:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon-blue {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.1) 100%);
    color: var(--primary-light);
}

.stat-icon-green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--success-color);
}

.stat-icon-purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--secondary-color);
}

.stat-icon-orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--warning-color);
}

.stat-content {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 500;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}

.stat-trend svg {
    width: 14px;
    height: 14px;
}

.trend-up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.trend-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: var(--gray-400);
}

.stat-badge {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Actions Section */
.quick-actions-glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 20px;
}

.section-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    color: var(--gray-300);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.action-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    transform: translateY(-4px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.action-icon svg {
    width: 22px;
    height: 22px;
}

.action-icon-create {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: var(--primary-light);
}

.action-icon-link {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
    color: var(--success-color);
}

.action-icon-view {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(249, 115, 22, 0.2) 100%);
    color: var(--warning-color);
}

.action-icon-config {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    color: var(--secondary-color);
}

/* Glass Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title svg {
    width: 22px;
    height: 22px;
    color: var(--primary-light);
}

.card-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.glass-card-body {
    padding: 20px 24px;
}

/* Empty State Glass */
.empty-state-glass {
    text-align: center;
    padding: 50px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state-glass h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 8px;
}

.empty-state-glass p {
    color: var(--gray-400);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Glass Table */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.glass-table thead tr {
    background: rgba(255, 255, 255, 0.02);
}

.glass-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.glass-table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.glass-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.glass-table td {
    padding: 16px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--gray-300);
    font-size: 14px;
}

.glass-table tbody tr td:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.glass-table tbody tr td:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Table Cell Styling */
.cell-title .cell-text {
    font-weight: 500;
    color: var(--white);
}

.cell-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.cell-badge svg {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
}

.cell-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-400);
    font-size: 13px;
}

.cell-date svg {
    width: 14px;
    height: 14px;
}

.cell-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.cell-email {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cell-email svg {
    width: 14px;
    height: 14px;
    color: var(--gray-500);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-active .status-dot {
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.action-btn-edit:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
}

.action-btn-view:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success-color);
}

.action-btn-link:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning-color);
}

/* Tables Section */
.tables-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .tables-section {
        grid-template-columns: 1fr;
    }
}

/* Responsive Dark Theme */
@media (max-width: 1024px) {
    .sidebar-dark {
        width: 240px;
    }
    
    .main-content-dark {
        margin-left: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar-dark {
        width: 100%;
        height: auto;
        position: relative;
        transform: none;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar-header-dark {
        width: 100%;
        text-align: left;
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .sidebar-logo {
        margin-bottom: 0;
    }
    
    .sidebar-nav {
        width: 100%;
        padding: 10px 0;
    }
    
    .nav-list {
        display: flex;
        flex-wrap: wrap;
        padding: 0 12px;
        gap: 4px;
    }
    
    .nav-list li {
        flex: 0 0 auto;
    }
    
    .nav-link {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content-dark {
        margin-left: 0;
        padding: 20px;
    }
    
    .top-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .page-header-dark {
        flex-direction: column;
        gap: 20px;
    }
    
    .welcome-section h1 {
        font-size: 26px;
    }
    
    .header-buttons {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card-glass {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 26px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-buttons {
        flex-direction: column;
    }
    
    .btn-glass {
        width: 100%;
        justify-content: center;
    }
}
