/* Teacher Transfer System - Custom Styles */
/* Bootstrap 3 Integration with Marathi Font Support */

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

/* Root Variables for Color Scheme */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --marathi-font: 'Ek Mukta', sans-serif;
}

/* Global Font Settings */
body {
    font-family: var(--marathi-font);
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

/* Header Styles */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10010; /* ensure on top of content */
}

.navbar-custom .navbar-brand {
    color: white !important;
    font-weight: 600;
    font-size: 24px;
}

.navbar-custom .navbar-nav > li > a {
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-custom .navbar-nav > li > a:hover {
    background-color: rgba(255,255,255,0.1) !important;
    border-radius: 4px;
}

/* Caret color on dark navbar */
.navbar-custom .navbar-nav > li > a .caret {
    border-top-color: #fff;
    border-bottom-color: #fff;
}

/* Mobile toggle (hamburger) visibility and contrast */
.navbar-custom .navbar-toggle {
    border-color: rgba(255,255,255,0.6);
}
.navbar-custom .navbar-toggle .icon-bar {
    background-color: #ffffff;
}
@media (max-width: 767px) {
    .navbar-custom .navbar-toggle { display: block; }
}

/* Active/open state styling */
.navbar-custom .navbar-nav > li.open > a,
.navbar-custom .navbar-nav > li.open > a:focus,
.navbar-custom .navbar-nav > li.open > a:hover {
    background-color: rgba(255,255,255,0.12) !important;
    border-radius: 4px;
    color: #fff !important;
}

/* Navbar Dropdowns - improved visibility and usability */
.navbar-custom .dropdown-menu {
    background: #ffffff;
    border: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    padding: 8px 0;
    z-index: 10020;
    margin-top: 8px;
    border-radius: 8px;
}

/* Make sure collapse container doesn't clip dropdown */
.navbar-custom .navbar-collapse { overflow: visible !important; }

/* Display when open via Bootstrap's .open class */
.navbar-custom .open > .dropdown-menu { display: block; }

.navbar-custom .dropdown-menu > li > a {
    color: #2c3e50;
    padding: 10px 20px;
}

.navbar-custom .dropdown-menu > li > a:hover {
    background-color: rgba(52,152,219,0.1);
}

/* Divider inside dropdown */
.navbar-custom .dropdown-menu .divider { 
    background-color: #ecf0f1; height: 1px; margin: 6px 0; 
}

/* Right-aligned dropdowns should align to the right edge */
.navbar-custom .navbar-right .dropdown-menu { right: 0; left: auto; }

/* Open dropdowns on hover for desktop */
@media (min-width: 768px) {
    .navbar-custom .dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* Mobile navbar: ensure dropdowns are visible inside collapsed menu */
@media (max-width: 767px) {
    .navbar-custom .navbar-collapse { overflow: visible !important; }
    .navbar-custom .navbar-nav .open .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
    .navbar-custom .navbar-nav .open .dropdown-menu > li > a {
        color: #fff; /* on gradient navbar */
        padding-left: 30px; /* indent items under parent */
    }
    .navbar-custom .dropdown-menu .divider { display: none; }
}

/* Card Styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    border: none;
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Button Styles */
.btn-custom-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-custom-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    color: white;
}

.btn-custom-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #2ecc71 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-custom-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    color: white;
}

.btn-custom-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-custom-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
    color: white;
}

.btn-custom-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-custom-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    color: white;
}

/* Form Styles */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 15px;
    font-family: var(--marathi-font);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-group label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

/* Table Styles */
.table-custom {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.table-custom thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.table-custom thead th {
    border: none;
    font-weight: 600;
    padding: 15px;
}

.table-custom tbody td {
    padding: 12px 15px;
    border-color: #e9ecef;
    vertical-align: middle;
}

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

/* Dashboard Stats */
.stats-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stats-label {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
}

.stats-primary .stats-number { color: var(--primary-color); }
.stats-success .stats-number { color: var(--success-color); }
.stats-warning .stats-number { color: var(--warning-color); }
.stats-danger .stats-number { color: var(--danger-color); }

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
    font-weight: 500;
    padding: 15px 20px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

.upload-area.dragover {
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

/* Ensure footer helper text is readable and wraps on mobile */
.footer p {
    margin: 0;
}
.footer a { text-decoration: underline; }
@media (max-width: 767px) {
    .footer .text-right { text-align: left; margin-top: 10px; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        margin-bottom: 15px;
    }
    
    .stats-card {
        margin-bottom: 20px;
    }
    
    .table-responsive {
        border-radius: 10px;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* --------------------------------------------- */
/* Bootstrap 3 dropdowns and selects - standardize */
/* Ensures consistent sizing and readable Marathi text */
/* --------------------------------------------- */

/* Global dropdown menu typography to match BS3 defaults */
.dropdown-menu {
    font-size: 14px;
    line-height: 1.42857143;
}

/* Improve readability and wrapping for long Marathi labels */
.dropdown-menu > li > a {
    padding: 8px 20px; /* slightly larger tap target */
    white-space: normal; /* allow wrapping */
    word-break: break-word;
    color: #2c3e50;
}

/* Keep dropdown scrollable on smaller viewports */
.navbar-custom .dropdown-menu {
    max-height: 70vh;
    overflow-y: auto;
}

/* Align icons inside dropdown links */
.dropdown-menu > li > a .fa {
    width: 16px;
    text-align: center;
}

/* Standardize <select> controls for clear text rendering */
select.form-control {
    height: auto; /* let content define height */
    padding-top: 6px;
    padding-bottom: 6px;
    line-height: 1.42857143;
    font-size: 14px;
    background-color: #fff;
    color: #2c3e50;
}

/* Multi/select with size attribute should expand naturally */
select[multiple].form-control,
select[size].form-control {
    height: auto;
}

/* Ensure option text uses readable sizing and wraps if needed */
.form-control option {
    font-size: 14px;
    line-height: 1.42857143;
    white-space: normal;
    color: #2c3e50;
}

/* Slight spacing when label precedes a control */
.form-group label + .form-control {
    margin-bottom: 10px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
