@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/**
 * File: css/revgem-theme.css
 * Centralized Design System & Theme Stylesheet for schoolink-web (RevGem - Revamp Gemini)
 */

:root {
    --revgem-primary: #0d9488;
    --revgem-primary-dark: #0f766e;
    --revgem-primary-light: #ccfbf1;
    --revgem-secondary: #64748b;
    --revgem-bg-main: #f8fafc;
    --revgem-card-bg: #ffffff;
    --revgem-text-dark: #0f172a;
    --revgem-text-muted: #64748b;
    --revgem-border-color: #e2e8f0;
    
    --revgem-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --revgem-shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08);
    --revgem-shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
    
    --revgem-radius-sm: 8px;
    --revgem-radius-md: 12px;
    --revgem-radius-lg: 16px;
}

/* Base Reset & Typography */
.revgem-wrapper * {
    box-sizing: border-box;
}

.revgem-container {
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--revgem-text-dark);
    font-size: 17px;
    line-height: 1.6;
}

/* Page Header */
.revgem-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: #1e3a8a;
    padding: 24px;
    border-radius: var(--revgem-radius-lg);
    color: white;
    box-shadow: var(--revgem-shadow-md);
}

.revgem-page-header h1 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    margin: 0;
}

.revgem-page-header p {
    color: #dbeafe;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 0;
}

/* Buttons */
.btn-revgem-primary {
    background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--revgem-radius-md);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-revgem-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
}

.btn-revgem-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-revgem-detail { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.btn-revgem-detail:hover { background: #bae6fd; }

.btn-revgem-duplicate { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.btn-revgem-duplicate:hover { background: #fde68a; }

.btn-revgem-edit { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.btn-revgem-edit:hover { background: #e2e8f0; }

.btn-revgem-delete { background: #ffe4e6; color: #be123c; border-color: #fecdd3; }
.btn-revgem-delete:hover { background: #fecdd3; }

/* Metric Summary Cards */
.revgem-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.revgem-metric-card {
    background: var(--revgem-card-bg);
    padding: 18px;
    border-radius: var(--revgem-radius-md);
    border: 1px solid var(--revgem-border-color);
    box-shadow: var(--revgem-shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease;
}

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

.revgem-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.revgem-metric-icon.teal { background: #ccfbf1; color: #0d9488; }
.revgem-metric-icon.blue { background: #dbeafe; color: #2563eb; }
.revgem-metric-icon.purple { background: #f3e8ff; color: #9333ea; }
.revgem-metric-icon.amber { background: #fef3c7; color: #d97706; }

.revgem-metric-info h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--revgem-text-muted);
    letter-spacing: 0.5px;
    margin: 0;
}

.revgem-metric-info .value {
    font-size: 18px;
    font-weight: 800;
    color: var(--revgem-text-dark);
    margin-top: 2px;
}

/* Toolbar & Filters */
.revgem-toolbar {
    background: var(--revgem-card-bg);
    padding: 16px 20px;
    border-radius: var(--revgem-radius-md);
    border: 1px solid var(--revgem-border-color);
    box-shadow: var(--revgem-shadow-sm);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.revgem-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.revgem-form-select, .revgem-form-input {
    padding: 8px 12px;
    border: 1px solid var(--revgem-border-color);
    border-radius: var(--revgem-radius-sm);
    font-size: 12px;
    outline: none;
    background-color: #ffffff;
    color: var(--revgem-text-dark);
    transition: border-color 0.2s ease;
}

.revgem-form-select:focus, .revgem-form-input:focus {
    border-color: var(--revgem-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.revgem-search-box {
    position: relative;
    min-width: 220px;
}

.revgem-search-box input {
    width: 100%;
    padding-left: 34px;
}

.revgem-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--revgem-text-muted);
}

.revgem-view-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--revgem-radius-sm);
    gap: 2px;
}

.revgem-view-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--revgem-text-muted);
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.revgem-view-btn.active {
    background: white;
    color: var(--revgem-primary-dark);
    box-shadow: var(--revgem-shadow-sm);
}

/* Badges */
.revgem-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    display: inline-block;
}

.revgem-badge-teal {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: white;
}

.revgem-badge-indigo {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.revgem-badge-slate {
    background: #f1f5f9;
    color: #334155;
}

/* Cards Grid */
.revgem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.revgem-card {
    background: var(--revgem-card-bg);
    border-radius: var(--revgem-radius-md);
    border: 1px solid var(--revgem-border-color);
    box-shadow: var(--revgem-shadow-sm);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.revgem-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--revgem-shadow-md);
    border-color: #cbd5e1;
}

/* Table View */
.revgem-table-container {
    background: var(--revgem-card-bg);
    border-radius: var(--revgem-radius-md);
    border: 1px solid var(--revgem-border-color);
    box-shadow: var(--revgem-shadow-sm);
    overflow-x: auto;
}

.revgem-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12px;
}

.revgem-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    font-size: 11px;
    border-bottom: 1px solid var(--revgem-border-color);
}

.revgem-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

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

/* Modal Overlay & Card */
.revgem-modal-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important; height: 100vh !important;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 99999;
    overflow: hidden !important;
    padding: 16px;
}

.revgem-modal-overlay.active,
.revgem-modal-flex.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
}

html.revgem-modal-open,
body.revgem-modal-open {
    overflow: hidden !important;
}

.revgem-modal-card {
    max-width: 850px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: var(--revgem-radius-lg);
    box-shadow: var(--revgem-shadow-lg);
    overflow: hidden;
    animation: revgemModalFade 0.25s ease-out;
}

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

.revgem-modal-header {
    background: #1e3a8a;
    color: white;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.revgem-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* State Containers */
.revgem-state-container {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--revgem-radius-md);
    border: 1px solid var(--revgem-border-color);
}

.revgem-state-container i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.revgem-state-container h4 {
    font-size: 15px;
    color: var(--revgem-text-dark);
    margin-bottom: 4px;
}

/* Tree View & Hierarchical Component Styles (from kelompok_mapel) */
.revgem-tree-container, .kelompok-mapel-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: transparent;
}

.revgem-scrollbar-hide, .scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.revgem-scrollbar-hide, .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Tree View connecting lines */
.revgem-tree-line::before, .tree-line::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: 12px;
    left: 11px;
    width: 2px;
    background-color: #e5e7eb;
    z-index: 0;
}

.revgem-tree-item::before, .tree-item::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -19px;
    width: 15px;
    height: 2px;
    background-color: #e5e7eb;
    z-index: 0;
}

/* ==========================================
   REVGEM STANDARDIZED PAGINATION COMPONENT
   ========================================== */
.revgem-pagination-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    margin-top: 16px;
}

@media (min-width: 640px) {
    .revgem-pagination-bar {
        flex-direction: row;
    }
}

.revgem-pagination-info {
    font-size: 16px;
    font-weight: 700;
    color: #475569;
}

.revgem-pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.revgem-pagination-btn {
    padding: 8px 16px;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.revgem-pagination-btn:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.revgem-pagination-btn.active {
    background-color: #4f46e5;
    color: #ffffff;
    font-weight: 800;
    border-color: #4338ca;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.revgem-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================
   REVGEM MATRIX TABLE ROYAL INDIGO BLUE THEME
   ========================================== */
.revgem-matrix-table thead tr:nth-child(1) th,
.revgem-matrix-header-layer1 {
    background: #1e3a8a !important;
    color: #ffffff !important;
    border-bottom: 1px solid #1d4ed8 !important;
}

.revgem-matrix-table thead tr:nth-child(2) th,
.revgem-matrix-header-layer2 {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #2563eb !important;
}

.revgem-matrix-table thead tr:nth-child(3) th,
.revgem-matrix-header-layer3 {
    background: #2563eb !important;
    color: #ffffff !important;
    border-bottom: 2px solid #1d4ed8 !important;
}

/* Header Click Sortable Styles */
th[data-sort] {
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
th[data-sort]:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
}
th[data-sort] .sort-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* ==========================================
   REVGEM FLOATING TOAST NOTIFICATION CONTAINER
   ========================================== */
#revgem-toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 999999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    pointer-events: none !important;
    max-width: 420px !important;
    width: calc(100% - 40px) !important;
    margin: 0 !important;
    padding: 0 !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
}
