/* 
 * Premium Design System: Glassmorphism Dark Blue Slate
 * Monev SPMB SLB TP 2026/2027
 */

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

:root {
    --bg-color: #080c14;
    --panel-bg: rgba(13, 20, 35, 0.7);
    --panel-hover: rgba(20, 30, 50, 0.85);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(14, 165, 233, 0.3);
    
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --primary: #0ea5e9;
    --primary-glow: rgba(14, 165, 233, 0.2);
    --secondary: #d946ef;
    --secondary-glow: rgba(217, 70, 239, 0.2);
    
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.2);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    --sidebar-width: 280px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.12) 0px, transparent 40%),
        radial-gradient(at 100% 0%, rgba(217, 70, 239, 0.08) 0px, transparent 40%),
        radial-gradient(at 50% 100%, rgba(99, 102, 241, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Core Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(11, 17, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.logo-title {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.user-profile-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.user-info {
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-item a:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active a {
    color: white;
    background: linear-gradient(135deg, var(--primary-glow) 0%, rgba(217, 70, 239, 0.05) 100%);
    border-color: var(--border-hover);
    box-shadow: inset 0 0 12px rgba(14, 165, 233, 0.05);
}

.nav-item.active a svg {
    color: var(--primary);
    filter: drop-shadow(0 0 4px var(--primary));
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: auto;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 2.5rem;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Cards & Glass Containers */
.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    transition: var(--transition);
}

.glass-card.accent-primary::before {
    background: var(--primary);
}

.glass-card.accent-secondary::before {
    background: var(--secondary);
}

.glass-card.accent-success::before {
    background: var(--success);
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover .stat-icon-box {
    transform: scale(1.08);
}

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

.stat-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-top: 2px;
    line-height: 1.2;
}

/* Grid Layouts */
.content-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.content-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 1024px) {
    .content-grid-2 {
        grid-template-columns: 1fr;
    }
}

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

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

.custom-table th {
    padding: 1.2rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    transition: var(--transition);
}

.custom-table tbody tr {
    transition: var(--transition);
}

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

.custom-table tbody tr:hover td {
    color: white;
}

/* Badges & Indicators */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-primary {
    background: var(--primary-glow);
    border-color: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
}

.badge-success {
    background: var(--success-glow);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.badge-warning {
    background: var(--warning-glow);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.badge-danger {
    background: var(--danger-glow);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Form Styling */
.form-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 12px var(--primary-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2rem;
    padding-right: 3rem;
}

select.form-control option {
    background: #0f172a;
    color: white;
}

/* Beautiful Interactive Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(217, 70, 239, 0.4);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px var(--success-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Interactive Tabs Component */
.tabs-container {
    margin-bottom: 2rem;
}

.tabs-list {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    list-style: none;
    overflow-x: auto;
}

.tab-item {
    flex-grow: 1;
}

.tab-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.02);
}

.tab-item.active .tab-btn {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.tab-item.active .tab-btn::after {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-panel.active {
    display: block;
}

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

/* Monev Questions List Styling */
.question-item {
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
}

.question-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.question-item:first-child {
    padding-top: 0;
}

.q-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.q-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.q-text {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.6;
    flex-grow: 1;
    color: white;
}

.q-law {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
}

.q-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .q-action-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Custom Interactive Scale Slider (Score 1-5) */
.slider-group {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 16px;
}

.scale-label-box {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.scale-input-container {
    position: relative;
    margin-bottom: 1rem;
}

.scale-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.6);
    transition: transform 0.1s;
}

.scale-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.scale-values-marker {
    display: flex;
    justify-content: space-between;
    padding: 0 6px;
}

.marker-dot {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.marker-dot.active {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

.rubric-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
    min-height: 48px;
}

/* Compliance Ring & Score Visualizers */
.compliance-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
}

.compliance-ring {
    position: relative;
    width: 150px;
    height: 150px;
}

.compliance-ring svg {
    width: 150px;
    height: 150px;
    transform: rotate(-90deg);
}

.compliance-ring circle {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
}

.compliance-ring .bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.compliance-ring .progress {
    stroke: url(#gradient);
    stroke-dasharray: 440; /* 2 * PI * r (r=70) -> approx 440 */
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 1s ease-out;
}

.compliance-ring .text-val {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-align: center;
}

.compliance-ring .text-val span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* File Upload styling */
.file-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    position: relative;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition);
}

.file-upload-box:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.02);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.file-upload-label svg {
    color: var(--primary);
}

.uploaded-file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    color: var(--text-color);
    margin-top: 0.5rem;
}

.uploaded-file-info a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Login Page Styling */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 450px;
    margin: 2rem auto;
}

.logo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-header .logo-icon {
    margin: 0 auto 1rem auto;
}

/* Alert Boxes */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.alert-info {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.25);
    color: #38bdf8;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

/* Responsive adjust for mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
