/* CSS Design System for Library Management System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #0ea5e9;
    --secondary-hover: #0284c7;
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --dark: #0f172a;
    --dark-card: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    
    --text-main: #334155;
    --text-muted: #64748b;
    --text-white: #f8fafc;
    
    --border-color: #e2e8f0;
    --border-dark: #334155;
    
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(99, 102, 241, 0.1), 0 8px 10px -6px rgba(99, 102, 241, 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font);
    background-color: var(--light);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utility Layouts */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--light);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Navigation Layout */
.navbar {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--dark);
    text-decoration: none;
}

.navbar-brand span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
    margin-left: auto;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Hero Section */
.hero {
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 90.1%);
    padding: 6rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

/* Form Styles */
.card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-main);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: var(--transition);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

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

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--light);
    border-color: #cbd5e1;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Alert Boxes */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.2);
}

/* Installer Widget CSS */
.installer-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, rgba(14, 165, 233, 0.05) 90.1%), var(--light);
    padding: 2rem 1rem;
}

.installer-card {
    width: 100%;
    max-width: 550px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

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

.installer-logo h2 {
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--dark);
    margin-top: 0.5rem;
}

.installer-logo h2 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.installer-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.installer-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.step-indicator.active {
    border-color: var(--primary);
    background-color: var(--primary);
    color: var(--white);
}

.step-indicator.completed {
    border-color: var(--success);
    background-color: var(--success);
    color: var(--white);
}

/* Dashboard Shell Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background-color: var(--dark);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 99;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-logo {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-logo span {
    background: linear-gradient(135deg, #a5b4fc, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-user {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-item-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sidebar-item-link:hover, .sidebar-item-link.active {
    color: var(--white);
    background-color: var(--dark-card);
}

.sidebar-item-link.active {
    background-color: var(--primary);
    color: var(--white);
}

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border-dark);
}

.main-content {
    flex-grow: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--light);
}

.top-bar {
    height: 70px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 98;
    margin: -2rem -2rem 2rem -2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

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

.stat-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Table Style */
.table-container {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
}

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

.table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--secondary);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

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

.modal-content {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.25s ease;
    overflow: hidden;
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: #f8fafc;
}

/* NOC Layout Styles */
.noc-certificate {
    width: 800px;
    min-height: 500px;
    margin: 2rem auto;
    padding: 3rem;
    border: 10px double var(--primary);
    background-color: var(--white);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    box-shadow: var(--shadow-lg);
    color: #1e293b;
    font-family: 'Georgia', serif;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.noc-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    color: rgba(99, 102, 241, 0.05);
    font-weight: 800;
    letter-spacing: 0.1em;
    user-select: none;
    z-index: 1;
}

.noc-header {
    text-align: center;
    z-index: 2;
}

.noc-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    font-family: var(--font);
}

.noc-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font);
}

.noc-body {
    margin: 2.5rem 0;
    font-size: 1.15rem;
    line-height: 1.8;
    text-align: justify;
    z-index: 2;
}

.noc-signatory-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 3rem;
    z-index: 2;
}

.noc-signatory {
    text-align: center;
    width: 220px;
}

.noc-signature-img {
    max-height: 60px;
    max-width: 180px;
    margin-bottom: 0.5rem;
    object-fit: contain;
}

.noc-signatory-line {
    border-top: 1px solid #475569;
    padding-top: 0.5rem;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
}

.noc-signatory-title {
    font-family: var(--font);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }
    .noc-certificate, .noc-certificate * {
        visibility: visible;
    }
    .noc-certificate {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        border: none;
        box-shadow: none;
        width: 100%;
        height: 100%;
    }
    .no-print {
        display: none !important;
    }
}

/* Academic Page Cards */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.class-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
}

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

.class-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.class-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
}

.class-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.class-card-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light);
}

.class-card-stat:last-child {
    border-bottom: none;
}

.class-card-footer {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Grid & Dashboard layout custom modifications */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .sidebar {
        width: 70px;
    }
    .sidebar-user, .sidebar-logo span, .sidebar-item-link span, .sidebar-footer span {
        display: none;
    }
    .sidebar-header {
        justify-content: center;
        padding: 0;
    }
    .sidebar-menu {
        padding: 1rem 0.25rem;
    }
    .sidebar-item-link {
        justify-content: center;
        padding: 0.75rem;
    }
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .navbar-brand span {
        font-size: 1rem;
    }
    .nav-links {
        display: none;
    }
    .hero-title {
        font-size: 2.25rem;
    }
    .main-content {
        padding: 1.5rem 1rem;
    }
}
