/* ============================================
   FILE: assets/css/style.css
   Complete CSS for IBS Admission Portal
   ============================================ */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ----- CSS Variables ----- */
:root {
    --primary: #005fa9;
    --primary-dark: #004a85;
    --primary-light: #e8f0fe;
    --primary-gradient: linear-gradient(135deg, #005fa9 0%, #003d6b 100%);
    --secondary: #1d7a5e;
    --text-dark: #1a2a3a;
    --text-gray: #5a6f82;
    --text-light: #8a9aa8;
    --border-light: #e6edf4;
    --bg-light: #f5f8fc;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 60px rgba(0, 95, 169, 0.10);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Reset & Base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ----- Dashboard Wrapper ----- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
    padding: 24px 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sidebar .brand img {
    height: 50px;
    width: auto;
    margin-bottom: 8px;
}

.sidebar .brand .brand-text h2 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin: 0;
}

.sidebar .brand .brand-text span {
    display: block;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0 12px;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
}

.sidebar-menu li a i {
    width: 20px;
    font-size: 0.95rem;
    color: var(--text-light);
    transition: var(--transition);
}

.sidebar-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu li a:hover i {
    color: var(--primary);
}

.sidebar-menu li.active a {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-menu li.active a i {
    color: var(--primary);
}

.sidebar-menu li .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-menu li.divider {
    border-top: 1px solid var(--border-light);
    margin: 12px 14px;
}

.sidebar-menu li .logout-link {
    color: #dc3545;
}

.sidebar-menu li .logout-link i {
    color: #dc3545;
}

.sidebar-menu li .logout-link:hover {
    background: #f8d7da;
    color: #a71d2a;
}

.sidebar-menu li .logout-link:hover i {
    color: #a71d2a;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    padding: 28px 35px;
    overflow-x: auto;
    min-width: 0;
}

/* ============================================
   HEADER BAR
   ============================================ */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.header-bar .page-title h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
    margin: 0;
}

.header-bar .page-title h1 i {
    color: var(--primary);
    margin-right: 8px;
}

.header-bar .page-title p {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin: 2px 0 0 0;
    font-weight: 400;
}

.header-bar .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-bar .user-info .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.header-bar .user-info .user-details {
    text-align: right;
}

.header-bar .user-info .user-details .name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.header-bar .user-info .user-details .role {
    font-size: 0.7rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-white);
    padding: 18px 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-number,
.stat-card .stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-card .stat-icon {
    float: right;
    font-size: 1.5rem;
    opacity: 0.25;
    color: var(--primary);
}

.stat-card.pending {
    border-left-color: #ffc107;
}

.stat-card.approved {
    border-left-color: #28a745;
}

.stat-card.rejected {
    border-left-color: #dc3545;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pending {
    background: #fff3cd;
    color: #7a5d0b;
}

.status-verified {
    background: #cce5ff;
    color: #004085;
}

.status-approved {
    background: #d4edda;
    color: #0b5e3b;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-draft {
    background: #e9ecef;
    color: #495057;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 95, 169, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 95, 169, 0.35);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-sm {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary-sm {
    background: var(--primary);
    color: white;
}

.btn-primary-sm:hover {
    background: var(--primary-dark);
}

.btn-success-sm {
    background: #28a745;
    color: white;
}

.btn-success-sm:hover {
    background: #1e7e34;
}

.btn-danger-sm {
    background: #dc3545;
    color: white;
}

.btn-danger-sm:hover {
    background: #a71d2a;
}

/* ============================================
   ACTION BOX
   ============================================ */
.action-box {
    background: var(--bg-white);
    padding: 30px 28px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--primary-light);
}

.action-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.action-box p {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrap {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.table-wrap .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-wrap .table-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th {
    background: var(--bg-light);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-gray);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tr:hover td {
    background: var(--bg-light);
}

/* ============================================
   FORM SECTIONS
   ============================================ */
.form-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.form-section:hover {
    box-shadow: var(--shadow-md);
}

.form-section .section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.form-section .section-header .num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.form-section .section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.form-section .section-header .badge-optional {
    font-size: 0.65rem;
    color: var(--text-gray);
    background: var(--bg-light);
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 500;
    margin-left: auto;
}

/* ============================================
   FORM GRID
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-dark);
}

.form-group label .required {
    color: #dc3545;
    margin-left: 2px;
}

.form-group label i {
    width: 16px;
    color: var(--primary);
    font-size: 0.8rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-light);
    transition: var(--transition);
    width: 100%;
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 95, 169, 0.08);
    background: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 50px;
}

/* ============================================
   EDUCATION & WORK ROWS
   ============================================ */
.edu-row,
.work-row {
    background: var(--bg-light);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
}

.edu-row h4,
.work-row h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

/* ============================================
   FILE UPLOAD
   ============================================ */
.file-upload-wrapper input[type="file"] {
    padding: 8px;
    background: var(--bg-light);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    width: 100%;
}

.file-upload-wrapper input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-wrapper .file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 4px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.file-upload-wrapper .file-info .file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

.file-upload-wrapper .file-info .file-remove {
    color: #dc3545;
    cursor: pointer;
}

/* ============================================
   FORM ACTIONS
   ============================================ */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #0b5e3b;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ============================================
   DETAIL VIEW
   ============================================ */
.detail-view {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    box-shadow: var(--shadow-md);
}

.detail-view .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-light);
}

.detail-view .detail-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.detail-view .detail-header h2 i {
    color: var(--primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 6px 24px;
    margin-bottom: 16px;
}

.detail-grid .item label {
    font-weight: 600;
    color: var(--text-gray);
    font-size: 0.75rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-grid .item .value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* ============================================
   DOCUMENT LIST
   ============================================ */
.document-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.document-item i {
    font-size: 1.2rem;
    color: var(--primary);
}

.document-item .doc-info {
    flex: 1;
}

.document-item .doc-info .doc-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-dark);
}

.document-item .doc-info .doc-name {
    font-size: 0.7rem;
    color: var(--text-gray);
}

.document-item .doc-actions {
    display: flex;
    gap: 4px;
}

.document-item .doc-actions a {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-decoration: none;
}

.document-item .doc-actions .view-btn {
    background: var(--primary);
    color: white;
}

.document-item .doc-actions .view-btn:hover {
    background: var(--primary-dark);
}

/* ============================================
   PAYMENT METHODS
   ============================================ */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 16px 0;
}

.payment-method input[type="radio"] {
    display: none;
}

.method-card {
    display: block;
    padding: 20px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    background: var(--bg-white);
}

.method-card:hover {
    border-color: var(--primary);
}

.payment-method input[type="radio"]:checked+.method-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.method-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.method-card h4 {
    color: var(--text-dark);
    margin-bottom: 4px;
    font-size: 1rem;
}

.method-card p {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.qr-display {
    margin-top: 12px;
}

.qr-display img {
    max-width: 140px;
    height: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px;
    background: white;
}

.bank-details {
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    text-align: left;
}

.bank-details p {
    margin: 2px 0;
    font-size: 0.85rem;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    .sidebar {
        display: none !important;
    }
    .main-content {
        padding: 0 !important;
    }
    .header-bar {
        display: none !important;
    }
    body {
        background: white !important;
    }
    .printable-form {
        box-shadow: none !important;
        padding: 20px !important;
    }
}

/* ============================================
   RESPONSIVE - SIDEBAR & MAIN
   ============================================ */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 12px 0;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .sidebar .brand {
        padding: 0 16px 0 16px;
        border-bottom: none;
        margin-bottom: 0;
        flex: 1;
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }

    .sidebar .brand img {
        height: 35px;
        margin-bottom: 0;
    }

    .sidebar .brand .brand-text h2 {
        font-size: 0.85rem;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        gap: 2px;
        padding: 0 12px;
        flex: 1;
        min-width: 100%;
        padding-top: 8px;
        border-top: 1px solid var(--border-light);
    }

    .sidebar-menu li {
        flex-shrink: 0;
    }

    .sidebar-menu li a {
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .sidebar-menu li a i {
        font-size: 0.8rem;
    }

    .sidebar-menu li .badge {
        display: none;
    }

    .sidebar-menu li.divider {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .header-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-bar .user-info {
        width: 100%;
        justify-content: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-section {
        padding: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .document-list {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-bar .page-title h1 {
        font-size: 1.1rem;
    }

    .main-content {
        padding: 12px;
    }

    .form-section {
        padding: 12px;
    }

    .stat-card .stat-number,
    .stat-card .stat-value {
        font-size: 1.2rem;
    }

    .sidebar .brand .brand-text h2 {
        font-size: 0.75rem;
    }

    .sidebar .brand img {
        height: 30px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-muted {
    color: var(--text-gray);
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}