@import 'dashboard.css';
@import 'report.css';

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin: 1rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.page-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.text-muted {
    color: #6c757d;
    margin: 0.2rem 0 0 0;
    font-size: 0.9rem;
}

/* Modern Table Wrapper for Responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 12px;
}

.modern-table {
    width: 100%;
    min-width: 600px;
    /* Force scroll on mobile instead of crushing content */
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.modern-table th {
    background: transparent;
    color: #8898aa;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    /* Slightly smaller for professional look */
    padding: 0.75rem 1rem;
    /* Shrunk padding */
    border-bottom: 2px solid #f8f9fe;
    text-align: left;
}

/* Specific alignment for Actions column (last child) */
.modern-table th:last-child {
    text-align: center;
}

.modern-table tbody tr {
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.modern-table tbody tr:hover {
    transform: scale(1.002);
    background: #f0f7ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.modern-table td {
    padding: 0.6rem 1rem;
    /* Shrunk padding from 1rem */
    border-top: 1px solid #f8f9fe;
    border-bottom: 1px solid #f8f9fe;
    vertical-align: middle;
}

.modern-table td:first-child {
    border-left: 1px solid #f0f0f0;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.modern-table td:last-child {
    border-right: 1px solid #f0f0f0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    text-align: center;
    /* Center action buttons */
}

/* Avatars & Badges */
.avatar-circle {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.badge {
    padding: 0.4em 0.8em;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-admin {
    background-color: #ffd1d1;
    color: #d9534f;
}

.badge-superadmin {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.badge-faculty {
    background-color: #d1ffd6;
    color: #28a745;
}

.badge-student {
    background-color: #d1ecff;
    color: #007bff;
}

/* Status Badges */
.badge-success {
    background-color: #2dce89;
    color: white;
}

.badge-info {
    background-color: #11cdef;
    color: white;
}

.badge-primary {
    background-color: #5e72e4;
    color: white;
}

.badge-warning {
    background-color: #fb6340;
    color: white;
}

.badge-secondary {
    background-color: #f7fafc;
    color: #32325d;
    border: 1px solid #e9ecef;
}

/* Buttons & Pagination */
.btn-icon-sm {
    background: white;
    border: 1px solid #eee;
    /* Add subtle border */
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    margin: 0 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-icon-sm:hover {
    color: var(--primary-color);
    background: #f8f9fa;
    transform: translateY(-1px);
}

.btn-icon-sm.delete {
    color: #dc3545;
}

.btn-icon-sm.delete:hover {
    background: #fff5f5;
    border-color: #ffcccc;
}

.btn-icon-sm.edit {
    color: #007bff;
}

.btn-icon-sm.edit:hover {
    background: #eef7ff;
    border-color: #cce5ff;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.page-info {
    color: #6c757d;
    font-weight: 500;
}

/* Modal Styles override */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Increased from 1000 to ensure it's above everything */
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 500px;
    /* Wider modal */
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUp 0.3s ease;
    z-index: 10000;
    /* Ensure modal card is above the overlay */
    position: relative;
    /* Ensure z-index takes effect */
}


.modal-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.25rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.btn-primary,
.btn-secondary,
.btn-info,
.btn-success,
.btn-danger,
.btn-warning {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary i:first-child,
.btn-secondary i:first-child,
.btn-info i:first-child,
.btn-success i:first-child,
.btn-danger i:first-child,
.btn-warning i:first-child,
.badge i:first-child,
.btn i:first-child {
    margin-right: 8px;
}

.btn i:last-child:not(:only-child),
.badge i:last-child:not(:only-child) {
    margin-left: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #357abd 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    filter: brightness(1.1);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
    color: #212529;
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

/* Login Page Styles */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-header p {
    color: #6c757d;
    font-size: 0.95rem;
}

.login-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    background: rgba(74, 144, 226, 0.1);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.login-card {
    max-width: 450px;
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    z-index: 2;
    pointer-events: none;
    font-size: 1.1rem;
}

/* Login form specific styles - override compact-ui.css */
.login-form .form-control,
.login-form input.form-control {
    width: 100%;
    padding: 14px 15px 14px 50px !important;
    /* Force left padding for icon */
    border: 2px solid #e1e1e1 !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    height: auto !important;
    line-height: normal !important;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-form .form-control:focus,
.login-form input.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
    outline: none;
}

/* General form-control styles (for other pages) */
.form-control {
    width: 100%;
    padding: 14px 15px 14px 50px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    outline: none;
}

.btn-block {
    width: 100%;
    font-weight: 600;
    padding: 14px;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ml-2 {
    margin-left: 0.5rem;
}

/* Layout & Sidebar */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    background: #1a252f;
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #ecf0f1;
}

.sidebar-nav {
    padding: 1rem 0;
    flex-grow: 1;
}

.nav-header {
    color: var(--secondary-color);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: #34495e;
    color: white;
    border-left-color: var(--secondary-color);
}

.nav-item i {
    width: 25px;
    margin-right: 10px;
    text-align: center;
}

.nav-item:hover {
    background: #34495e;
    color: white;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    color: var(--secondary-color);
    border-left-color: var(--secondary-color);
}

/* Submenu Styles */
.nav-item-group {
    display: flex;
    flex-direction: column;
}

.nav-subitem {
    padding-left: 45px !important;
    font-size: 0.9rem;
    opacity: 0.85;
}

.nav-subitem:hover {
    opacity: 1;
}

.main-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
    min-width: 0;
    /* Prevents flex items from overflowing */
}

.top-nav {
    background: white;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ml-auto {
    margin-left: auto;
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

@media (max-width: 768px) {
    .content-body {
        padding: 1rem;
    }
}

.user-welcome {
    margin-right: 1.5rem;
    font-weight: 500;
    color: #555;
}

.nav-link {
    color: #666;
    text-decoration: none;
    margin-right: 1.5rem;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Adjust dashboard container if inside new layout */
.dashboard-container {
    padding: 0;
    /* Let content-body handle padding */
}

/* Footer Styles */
.hover-white:hover {
    color: #fff !important;
    padding-left: 5px;
    transition: all 0.3s;
}

.social-icons a {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.social-icons a:hover {
    transform: translateY(-3px);
}

.social-fb {
    color: #1877f2 !important;
}

.social-tw {
    color: #1da1f2 !important;
}

.social-li {
    color: #0077b5 !important;
}

.social-ig {
    color: #e4405f !important;
}

.social-icons a:hover.social-fb {
    background: rgba(24, 119, 242, 0.2);
}

.social-icons a:hover.social-tw {
    background: rgba(29, 161, 242, 0.2);
}

.social-icons a:hover.social-li {
    background: rgba(0, 119, 181, 0.2);
}

.social-icons a:hover.social-ig {
    background: rgba(228, 64, 95, 0.2);
}

/* Validation Styles */
.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.mandatory-star {
    color: #dc3545;
    margin-left: 2px;
}

.comment-bubble {
    background: #f0f7ff;
    border-left: 3px solid var(--primary-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #444;
    max-width: 250px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comment-bubble i {
    opacity: 0.7;
}

/* Spacing Utilities & Global Icon Margins */
.mr-1 {
    margin-right: 0.25rem !important;
}

.mr-2 {
    margin-right: 0.5rem !important;
}

.mr-3 {
    margin-right: 1rem !important;
}

.ml-1 {
    margin-left: 0.25rem !important;
}

.ml-2 {
    margin-left: 0.5rem !important;
}

.ml-3 {
    margin-left: 1rem !important;
}

/* Global Icon Spacing - Apply to ALL FontAwesome icons */
i.fas,
i.far,
i.fab,
i.fa,
.fas,
.far,
.fab,
.fa {
    margin-right: 8px !important;
}

/* Exception: Icons in buttons with only an icon should not have margin */
.btn-icon-sm i,
.close-btn i,
button i:only-child,
a i:only-child,
.input-group-text i:only-child {
    margin-right: 0 !important;
}

/* Exception: Icons that are explicitly at the end of text */
.ml-auto i,
.text-end i,
i.ml-2,
i.ml-3 {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* Ensure icons in all buttons have proper spacing */
.btn i,
.modal-footer .btn i,
button i,
a.btn i {
    margin-right: 8px !important;
}

/* Media Queries for better mobile experience */
@media screen and (max-width: 768px) {
    .glass-card {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-header .d-flex {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem !important;
    }

    .page-header .btn {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-section>div {
        grid-template-columns: 1fr !important;
    }

    /* Mobile Table Transformation */
    .modern-table {
        min-width: 100% !important;
        border-spacing: 0;
    }

    .modern-table thead {
        display: none;
        /* Hide headers on mobile */
    }

    .modern-table,
    .modern-table tbody,
    .modern-table tr,
    .modern-table td {
        display: block;
        width: 100%;
    }

    .modern-table tr {
        margin-bottom: 1.5rem;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .modern-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        text-align: right;
    }

    .modern-table td:last-child {
        border-bottom: none !important;
        justify-content: center;
        background: #f8f9fa;
        margin: 0.5rem -1rem -1rem -1rem;
        padding: 1rem;
        border-radius: 0 0 12px 12px;
    }

    .modern-table td:before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: #8898aa;
        text-align: left;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    /* First column usually has the name/title, style it as a header */
    .modern-table td:first-child {
        padding-bottom: 1rem;
        margin-bottom: 0.5rem;
        justify-content: flex-start;
        background: #f8fbff;
        margin: -1rem -1rem 0.5rem -1rem;
        padding: 1rem;
        border-radius: 12px 12px 0 0;
    }

    .modern-table td:first-child:before {
        display: none;
    }

    .table-responsive {
        overflow-x: visible !important;
        max-height: none !important;
    }

    /* Modal adjustments */
    .modal-card {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
    }

    .form-row {
        flex-direction: column;
        gap: 0 !important;
    }
}

/* Ensure icons in links have proper spacing */
a i:not(:only-child) {
    margin-right: 8px !important;
}

/* Ensure icons in badges have proper spacing */
.badge i {
    margin-right: 6px !important;
}

/* Ensure icons in nav items have proper spacing */
.nav-link i,
.nav-item i {
    margin-right: 8px !important;
}

/* Ensure icons in table cells have proper spacing */
td i:not(:only-child),
th i:not(:only-child) {
    margin-right: 8px !important;
}