/* Glass Modern Design System */
:root {
    --primary-color: #0F52BA;
    /* Sapphire Blue - Trust & Professionalism */
    --secondary-color: #D4AF37;
    /* Gold - Premium & Excellence */
    --bg-gradient-start: #f6f9fc;
    --bg-gradient-end: #eef2f7;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --radius-lg: 16px;
    --radius-md: 10px;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Safari support */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

/* Headers */
.page-header-glass {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
    /* Subtle Gold Line */
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--secondary-color);
}

/* Glass Table */
.glass-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
}

.glass-table th {
    background: linear-gradient(45deg, var(--primary-color), #2980b9);
    color: white;
    padding: 15px;
    font-weight: 600;
    text-align: right;
    /* RTL Default */
    border-bottom: 3px solid var(--secondary-color);
}

/* Bi-lingual Support */
[dir="ltr"] .glass-table th {
    text-align: left;
}

.glass-table td {
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
}

.glass-table tr:hover td {
    background: rgba(212, 175, 55, 0.05);
    /* Tint of Gold on Hover */
}

.glass-table tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-md);
}

.glass-table tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-md);
}

/* Buttons */
.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary-glass {
    background: linear-gradient(45deg, var(--primary-color), #2980b9);
    color: white;
}

.btn-primary-glass:hover {
    background: linear-gradient(45deg, #0d47a1, #1565c0);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(15, 82, 186, 0.3);
}

.btn-gold-glass {
    background: linear-gradient(45deg, var(--secondary-color), #f1c40f);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-gold-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(212, 175, 55, 0.4);
}

.btn-danger-glass {
    background: linear-gradient(45deg, #c0392b, #e74c3c);
    color: white;
}

.btn-success-glass {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
}

.btn-success-glass:hover {
    background: linear-gradient(45deg, #27ae60, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(46, 204, 113, 0.3);
}

.btn-action-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.btn-action-icon:hover {
    transform: scale(1.1);
}

.btn-edit {
    background: var(--primary-color);
}

.btn-delete {
    background: #e74c3c;
}

/* Form Styles */
.form-group-glass {
    margin-bottom: 1.5rem;
}

.form-label-glass {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
    /* Force Right Alignment */
    float: none;
    /* Override Bootstrap Float */
    width: 100%;
    /* Full Width */
}

.form-control-glass {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-md);
    transition: all 0.3s;
    font-size: 1rem;
}

.form-control-glass:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* ============================================
   Custom File Upload Zones
   ============================================ */
.custom-file-upload {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
    border: 2px dashed rgba(52, 152, 219, 0.5);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.custom-file-upload:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.2);
}

.custom-file-upload input[type="file"] {
    display: none;
}

.custom-file-upload .default-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.custom-file-upload .default-content i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.custom-file-upload .default-content p {
    color: #555;
    font-weight: bold;
    font-size: 1rem;
    margin: 0;
}

.custom-file-upload .preview-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-file-upload img.preview-full {
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    object-fit: contain;
}

/* Preview Gallery Grid */
.preview-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    width: 100%;
    padding: 10px;
}

.upload-preview-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid rgba(212, 175, 55, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.upload-preview-card:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.upload-preview-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}


/* Dashboard Stat Cards */
.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: var(--primary-color);
    border-radius: 0 5px 5px 0;
}

.stat-card.teachers::before {
    background: #4e73df;
}

.stat-card.students::before {
    background: #1cc88a;
}

.stat-card.classes::before {
    background: #36b9cc;
}

.stat-card.files::before {
    background: #f6c23e;
}

.stat-card.subjects::before {
    background: #e74a3b;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.teachers .stat-icon {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
}

.students .stat-icon {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
}

.classes .stat-icon {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%);
}

.files .stat-icon {
    background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%);
}

.subjects .stat-icon {
    background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    margin-top: 20px;
}

.form-control-glass-input {
    width: 90% !important;
    padding: 10px !important;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.form-control-glass-input:focus {
    border-color: #1217b4;
    box-shadow: 0 0 8px rgba(18, 23, 180, 0.3);
    outline: none;
}

/* AI Dashboard & Chatbot Components */
.ai-stats-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ai-card {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff;
    text-align: center;
    border-left: 5px solid #1217b4;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.ai-card:hover {
    transform: translateY(-5px);
}

.ai-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(18, 23, 180, 0.05) 0%, transparent 70%);
    transform: rotate(45deg);
    pointer-events: none;
}

.ai-card h3 {
    font-size: 32px;
    color: #333;
    margin: 10px 0;
    font-weight: bold;
}

.ai-card p {
    color: #777;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ai-card i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #1217b4;
}

/* Sentiment Icons */
.sentiment-icon {
    font-size: 1.2em;
    vertical-align: middle;
    margin-left: 5px;
}

.happy {
    color: #2ecc71;
}

.neutral {
    color: #f1c40f;
}

.sad {
    color: #e74c3c;
}

/* Custom Tab Styles for Chatbot */
.tab-nav-glass {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.tab-btn {
    background: rgba(12, 23, 180, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    color: #1217b4;
}

.tab-btn.active {
    background: #1217b4;
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* RTL Form Alignment Overrides */
.form-horizontal .control-label {
    float: right;
    width: 160px;
    padding-top: 5px;
    text-align: right;
    font-weight: bold;
}

.form-horizontal .controls {
    margin-right: 180px;
    margin-left: 0;
}

.page-title {
    text-align: right;
}

.glass-table th {
    text-align: right;
}

/* Enhanced Select Box Design */
select.form-control-glass {
    height: 45px !important;
    line-height: 45px;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    background-color: #ffffff !important;
    background-image: none !important;
    padding: 10px;
    color: #000000 !important;
    cursor: pointer;
    font-weight: bold;
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    width: 100%;
    box-sizing: border-box;
}

select.form-control-glass option {
    color: #000000 !important;
    background-color: #ffffff !important;
}

select.form-control-glass:hover {
    border-color: var(--secondary-color);
}


select.form-control-glass:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
    outline: none;
}

/* Sidebar Glass Overrides */
#sidebar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 10px 0;
}

#sidebar .nav-list>li>a {
    text-shadow: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    border-radius: 5px;
    margin: 2px 5px;
    padding: 8px 15px;
}

#sidebar .nav-list>li>a:hover {
    background: rgba(15, 82, 186, 0.1);
    color: var(--primary-color);
    transform: translateX(-5px);
    /* RTL Slide */
}

#sidebar .nav-list>.active>a,
#sidebar .nav-list>.active>a:hover,
#sidebar .nav-list>.active>a:focus {
    background: var(--primary-color);
    color: white;
    text-shadow: none;
    box-shadow: 0 4px 10px rgba(15, 82, 186, 0.3);
}

#sidebar .nav-header {
    text-shadow: none;
    color: var(--secondary-color);
    font-size: 0.9em;
    text-transform: uppercase;
    margin-top: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#sidebar i {
    font-size: 1.1em;
}

/* Glass Search Bar */
.search-glass-container {
    position: relative;
    margin-bottom: 20px;
}

.search-glass-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.95);
    /* Higher opacity for better contrast */
    transition: all 0.3s;
    font-family: inherit;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.search-glass-input:focus {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    outline: none;
    border-color: var(--primary-color);
}

.search-glass-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1em;
}

/* Empty State Illustration */
.empty-state-glass {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4em;
    color: #dfe6e9;
    /* Light gray */
    margin-bottom: 15px;
    display: block;
}