/* ==========================================================================
   ATHENA DIGITAL LIBRARY - STYLING DESIGN SYSTEM (VANILLA CSS)
   ========================================================================== */

:root {
    --bg-dark: #f4f6f9;          /* Sophisticated soft cool-gray background */
    --bg-surface: #ffffff;       /* Pure white sidebar and interface containers */
    --bg-card: rgba(255, 255, 255, 0.7); /* Light glassmorphic card base */
    --border-color: rgba(29, 39, 82, 0.08); /* Soft navy-tinted borders */
    
    --primary: #1d2752;          /* Logo navy primary for text, sidebar, and core actions */
    --primary-glow: rgba(29, 39, 82, 0.12); /* Soft shadow branding glow */
    --secondary: #d11215;        /* Logo red accent for highlights and alerts */
    --secondary-glow: rgba(209, 18, 21, 0.12);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #d11215;           /* Match logo red */
    
    --text-main: #1f2937;        /* Deep charcoal for excellent reading legibility */
    --text-muted: #4b5563;       /* Medium slate-gray for subtitles/metadata */
    --text-dark: #8c95a5;        /* Soft gray-blue for minor details and placeholders */
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --glass-shadow: 0 8px 32px 0 rgba(29, 39, 82, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ==========================================================================
   APP LAYOUT
   ========================================================================== */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* NAVBAR STYLING */
.navbar {
    width: 100%;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(29, 39, 82, 0.02);
}

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

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.brand h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.90rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 1.05rem;
    width: auto;
    text-align: center;
}

.nav-item:hover {
    color: var(--primary);
    background-color: rgba(29, 39, 82, 0.04);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-item.active i {
    color: #fff;
}

.system-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
}

/* MAIN CONTENT AREA */
.main-content {
    flex-grow: 1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* HEADER SECTION */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    gap: 20px;
}

.welcome h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    color: var(--primary);
    margin-bottom: 6px;
}

.welcome p {
    color: var(--text-muted);
    font-size: 1rem;
}

.stats-overview {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.purple {
    background: rgba(209, 18, 21, 0.12);
    color: var(--secondary);
    border: 1px solid rgba(209, 18, 21, 0.25);
}

.stat-icon.blue {
    background: rgba(29, 39, 82, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(29, 39, 82, 0.25);
}

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

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

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

/* ==========================================================================
   TAB CONTROL & TRANSITIONS
   ========================================================================== */

.content-body {
    position: relative;
    flex-grow: 1;
}

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

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

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

.pane-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.pane-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.65rem;
    color: var(--primary);
}

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

/* ==========================================================================
   TAB 1: LIBRARY SEARCH & GRID
   ========================================================================== */

.search-filter {
    position: relative;
    width: 280px;
}

.search-filter i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark);
    font-size: 0.85rem;
}

.search-filter input {
    width: 100%;
    background-color: rgba(29, 39, 82, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px 8px 36px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: var(--transition-smooth);
}

.search-filter input:focus {
    outline: none;
    background-color: var(--bg-surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* BOOKS GRID SYSTEM */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 25px;
    width: 100%;
}

.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    position: relative;
}

.book-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 54, 125, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-glow);
}

/* Dynamic Cover Image / PDF Render */
.book-cover-area {
    height: 190px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(26, 28, 46, 0.8) 0%, rgba(10, 11, 20, 0.9) 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Cover Upload Trigger Overlay */
.cover-upload-trigger-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 29, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.cover-upload-trigger-overlay i {
    font-size: 1.6rem;
    color: var(--secondary);
}

.book-cover-area:hover .cover-upload-trigger-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Beautiful Cover canvas generated on page load */
.book-cover-canvas {
    width: 110px;
    height: 155px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    transition: var(--transition-smooth);
    z-index: 2;
    background-color: #fff;
}

.book-card:hover .book-cover-canvas {
    transform: scale(1.05) rotate(-2deg);
}

/* Fallback Cover generated by JS using linear-gradients */
.book-cover-fallback {
    width: 110px;
    height: 155px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    z-index: 2;
    overflow: hidden;
}

.fallback-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.fallback-author {
    font-size: 0.6rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cover-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) opacity(0.25);
    z-index: 1;
}

.book-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(209, 18, 21, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(209, 18, 21, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    z-index: 3;
}

.book-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.book-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-author {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-desc {
    color: var(--text-dark);
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 5px 0;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.book-meta span i {
    margin-right: 5px;
    color: var(--primary);
}

/* Card Button Actions */
.book-actions {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    padding: 0 20px 20px 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37, 54, 125, 0.5);
    transform: translateY(-1px);
}

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

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

.btn-danger {
    background-color: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

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

.btn-icon {
    width: 38px;
    padding: 0;
    font-size: 1rem;
}

/* Spinner and Loadings */
.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    gap: 15px;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 2.5rem;
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    max-width: 450px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-state i {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary);
}

.empty-state p {
    color: var(--text-dark);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   TAB 2: UPLOAD BOOK FORM
   ========================================================================== */

.upload-split-layout {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
}

.upload-main-form {
    flex: 2;
    min-width: 500px;
}

.upload-categories-manager {
    flex: 1.1;
    min-width: 320px;
}

/* Category Table Styling */
.upload-categories-manager table tr {
    transition: background-color 0.2s ease;
}
.upload-categories-manager table tr:hover {
    background: rgba(29, 39, 82, 0.03);
}

.glass-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
}

.form-columns {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 2.5rem;
}

/* Drag Zone CSS */
.upload-zone-wrapper {
    width: 100%;
}

.upload-drag-zone {
    width: 100%;
    height: 100%;
    min-height: 320px;
    border: 2px dashed rgba(37, 54, 125, 0.4);
    border-radius: 20px;
    background: rgba(10, 11, 20, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
}

.upload-drag-zone:hover, .upload-drag-zone.dragover {
    border-color: var(--primary);
    background: rgba(37, 54, 125, 0.06);
}

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

.file-upload-icon {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.upload-drag-zone:hover .file-upload-icon {
    transform: scale(1.1);
}

.drag-message h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.drag-message p {
    color: var(--text-muted);
}

.drag-message span {
    color: var(--primary);
    font-weight: 600;
}

.file-specs {
    margin-top: 15px;
    font-size: 0.78rem;
    color: var(--text-dark);
}

.selected-file-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-surface);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 2;
    animation: fadeIn 0.3s ease;
}

.selected-file-indicator i {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 12px;
}

.selected-file-indicator span {
    font-weight: 600;
    color: var(--primary);
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 12px;
}

.remove-file-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.remove-file-btn:hover {
    background-color: var(--danger);
    color: #fff;
}

/* Fields Styling */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    background-color: rgba(29, 39, 82, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    width: 100%;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea {
    resize: vertical;
}

.helper-text {
    font-size: 0.78rem;
    color: var(--text-dark);
}

/* Progress bar container */
.progress-container {
    margin-top: 2rem;
    padding: 15px;
    border-radius: 12px;
    background-color: rgba(10, 11, 20, 0.4);
    border: 1px solid var(--border-color);
}

.progress-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 500;
}

.progress-bar-track {
    height: 6px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0%;
    transition: width 0.1s ease;
}

.form-actions {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* ==========================================================================
   TAB 3: INTEGRATION HUB
   ========================================================================== */

.integration-layout {
    display: grid;
    grid-template-columns: 1.7fr 1.3fr;
    gap: 2.5rem;
}

.integration-cards {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(16px);
}

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

.card-header h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary);
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge.purple {
    background: rgba(209, 18, 21, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(209, 18, 21, 0.3);
}

.badge.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 20px;
}

/* Clipboard fields */
.copy-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.copy-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-input-wrapper {
    display: flex;
    position: relative;
}

.copy-input-wrapper input {
    width: 100%;
    background-color: rgba(10, 11, 20, 0.6);
    border: 1px solid var(--border-color);
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 12px 14px;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.85rem;
}

.btn-copy {
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-copy:hover {
    background-color: #7c3aed;
}

.secure-embed-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.step-num {
    width: 24px;
    height: 24px;
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.moodle-settings-form h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.moodle-settings-form p {
    color: var(--text-dark);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.moodle-settings-form form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   TAB 4: SANDBOX LMS SIMULATOR
   ========================================================================== */

.sandbox-container {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.sandbox-logo {
    width: 70px;
    height: 70px;
    background: rgba(37, 54, 125, 0.15);
    border: 1px solid rgba(37, 54, 125, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 var(--primary-glow);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 54, 125, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 54, 125, 0);
    }
}

.sandbox-container h3 {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    color: var(--primary);
}

.sandbox-container p {
    color: var(--text-muted);
    font-size: 0.92rem;
    max-width: 85%;
    margin-bottom: 10px;
}

.sandbox-form {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 0.95rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================================================
   TOAST NOTIFICATION MODAL
   ========================================================================== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(18, 19, 30, 0.9);
    border: 1px solid var(--primary-glow);
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-weight: 500;
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.4);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.4);
}

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

/* ==========================================================================
   ATHENA LOGIN PORTAL & SECURITY STYLING
   ========================================================================== */

.login-portal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #ffffff 0%, #e8ecf3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s ease;
}

.login-portal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 2.8rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(29, 39, 82, 0.08), inset 0 1px 0 rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    animation: zoomInLogin 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes zoomInLogin {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 8px 25px var(--primary-glow);
    margin-bottom: 10px;
}

.login-header h2 {
    font-family: var(--font-heading);
    font-size: 1.95rem;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #fff 40%, #fca5a5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.login-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(29, 39, 82, 0.05);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.login-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-tab-btn:hover {
    color: var(--text-main);
}

.login-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(29, 39, 82, 0.08);
    border: 1px solid rgba(29, 39, 82, 0.04);
}

.login-pane {
    display: none;
    flex-direction: column;
    animation: fadeInPane 0.3s ease forwards;
}

.login-pane.active {
    display: flex;
}

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

.login-error {
    background: rgba(209, 18, 21, 0.06);
    border: 1px solid rgba(209, 18, 21, 0.15);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.logout-nav-item {
    border-color: rgba(209, 18, 21, 0.15) !important;
    color: var(--secondary) !important;
}

.logout-nav-item:hover {
    background-color: rgba(209, 18, 21, 0.05) !important;
    color: var(--secondary) !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS AND DRAWER ENGINE
   ========================================================================== */

/* Hamburger Button */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--primary);
    font-size: 1.3rem;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.mobile-nav-toggle:hover {
    background-color: rgba(29, 39, 82, 0.04);
    color: var(--secondary);
}

/* Mobile Slide-out Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    justify-content: flex-end;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.drawer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 20, 0.4);
    backdrop-filter: blur(4px);
}

.drawer-container {
    position: relative;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 1px solid var(--border-color);
}

.mobile-drawer:not(.hidden) .drawer-container {
    transform: translateX(0);
}

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

.drawer-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.drawer-close-btn:hover {
    background-color: rgba(209, 18, 21, 0.08);
    color: var(--secondary);
}

.drawer-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.mobile-search-filter {
    position: relative;
    margin-bottom: 1.5rem;
}

.mobile-search-filter i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark);
    font-size: 0.85rem;
}

.mobile-search-filter input {
    width: 100%;
    background-color: rgba(29, 39, 82, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px 10px 36px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: var(--transition-smooth);
}

.mobile-search-filter input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.drawer-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-menu .nav-item {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 992px) {
    .navbar {
        padding: 0.75rem 1.5rem;
    }
    
    .nav-menu {
        display: none !important; /* Hide horizontal desktop menu */
    }
    
    .navbar-right {
        display: none !important; /* Hide desktop search and logout */
    }
    
    .mobile-nav-toggle {
        display: flex; /* Show hamburger button */
    }
    
    .main-content {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .stats-overview {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .stat-card {
        flex-grow: 1;
    }
    
    .integration-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .form-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .welcome h1 {
        font-size: 1.8rem;
    }
    
    .pane-header h2 {
        font-size: 1.4rem;
    }
    
    .glass-form-container {
        padding: 1.5rem;
    }
    
    .upload-drag-zone {
        min-height: 240px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .welcome h1 {
        font-size: 1.5rem;
    }
    
    .welcome p {
        font-size: 0.88rem;
    }
    
    .stats-overview {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-card {
        width: 100%;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .book-actions {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0 15px 15px 15px;
    }
    
    .book-details {
        padding: 15px;
    }
    
    .login-box {
        padding: 1.5rem;
        gap: 1.2rem;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
}

/* Premium Logo Loader Animation */
.logo-loader-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-loader-img {
    width: 65px;
    height: auto;
    object-fit: contain;
    animation: logoPulse 2s infinite ease-in-out;
    z-index: 2;
}

.logo-loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(29, 39, 82, 0.05);
    border-top: 3px solid var(--primary);
    border-bottom: 3px solid var(--secondary);
    border-radius: 50%;
    animation: loaderRotate 1.5s infinite linear;
    z-index: 1;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(0.95);
        filter: drop-shadow(0 0 8px rgba(29, 39, 82, 0.25));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 25px rgba(209, 18, 21, 0.7));
    }
}

@keyframes loaderRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Global Page Loader Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #ffffff 0%, #e8ecf3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 400px;
}

.loading-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.loading-content p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

