/* EduVia Dershane - Custom Styles */

/* Color Variables */
:root {
    --primary-color: #2C5AA0;
    --secondary-color: #28A745;
    --background-color: #F8F9FA;
    --text-color: #212529;
    --accent-color: #FFC107;
    --error-color: #DC3545;
    --light-gray: #E9ECEF;
    --border-color: #DEE2E6;
    --banner-color: #f3f1e7;
    --banner-text-color: #e67e28;
}

/* Global Styles */
body {
    font-family: 'Open Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Bootstrap Color Overrides */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-banner{
    background-color: var(--banner-color) !important
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #1e3f7a;
    border-color: #1e3f7a;
}

.btn-success {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-success:hover, .btn-success:focus {
    background-color: #1e7e34;
    border-color: #1e7e34;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--secondary-color) !important;
}

.bg-success {
    background-color: var(--secondary-color) !important;
}

.bg-warning {
    background-color: var(--accent-color) !important;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Navbar banner styling */
.navbar-light .navbar-brand {
    color: var(--banner-text-color) !important;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--banner-text-color) !important;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: #1e3f7a !important;
}

.navbar-light .navbar-nav .dropdown-menu {
    background-color: var(--banner-color) !important;
}

.navbar-light .navbar-nav .dropdown-menu .dropdown-item {
    color: var(--banner-text-color) !important;
}

.navbar-light .navbar-nav .dropdown-menu .dropdown-item:hover {
    background-color: var(--light-gray) !important;
    color: #1e3f7a !important;
}

.navbar-light .navbar-toggler {
    border-color: var(--banner-text-color) !important;
}

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='%232C5AA0' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3f7a 100%);
    padding: 2rem 1rem;
}

.login-container .card {
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-container .form-control {
    border-radius: 0.75rem;
    border: 2px solid var(--light-gray);
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

.login-container .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background-color: white;
    border-bottom: 2px solid var(--light-gray);
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 2px solid var(--light-gray);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.15);
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tables */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--background-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
    padding: 1rem 0.75rem;
}

.table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--light-gray);
}

.table-hover tbody tr:hover {
    background-color: rgba(44, 90, 160, 0.05);
}

/* Avatar Initials */
.avatar-initial {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
    border-left: 4px solid;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left-color: var(--secondary-color);
    color: #155724;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: var(--error-color);
    color: #721c24;
}

.alert-info {
    background-color: rgba(44, 90, 160, 0.1);
    border-left-color: var(--primary-color);
    color: #0c5460;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: var(--accent-color);
    color: #856404;
}

/* Dashboard Statistics Cards */
.dashboard-stats .card {
    transition: all 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        border-radius: 0.5rem;
    }
    
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
    }
    
    .dashboard-stats .card {
        margin-bottom: 1rem;
    }
    
    /* Mobile form improvements */
    .row .col-md-6,
    .row .col-lg-6 {
        margin-bottom: 1rem;
    }


    
    .form-check {
        margin-bottom: 0.5rem;
    }
    
    .badge {
        display: inline-block;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 576px) {
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-toolbar {
        width: 100%;
    }
    
    .btn-toolbar .btn {
        width: 100%;
    }
    
    .table thead {
        display: none;
    }
    
    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }
    
    .table tr {
        border: 1px solid var(--border-color);
        border-radius: 0.5rem;
        padding: 1rem;
        margin-bottom: 1rem;
        background-color: white;
    }
    
    .table td {
        border: none;
        border-bottom: 1px solid var(--light-gray);
        position: relative;
        padding-left: 50% !important;
        text-align: left;
    }
    
    .table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-color);
    }
    
    .table td:last-child {
        border-bottom: none;
    }
}

/* Loading and Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

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

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #1e3f7a;
}

/* Markdown Styling */
.question-text {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.question-text h1,
.question-text h2,
.question-text h3,
.question-text h4,
.question-text h5,
.question-text h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.question-text h1 { font-size: 1.5rem; }
.question-text h2 { font-size: 1.4rem; }
.question-text h3 { font-size: 1.3rem; }
.question-text h4 { font-size: 1.2rem; }
.question-text h5 { font-size: 1.1rem; }
.question-text h6 { font-size: 1rem; }

.question-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

.question-text strong,
.question-text b {
    font-weight: 600;
    color: var(--primary-color);
}

.question-text em,
.question-text i {
    font-style: italic;
    color: #6c757d;
}

.question-text ul,
.question-text ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.question-text li {
    margin-bottom: 0.25rem;
}

.question-text blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
}

.question-text code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e83e8c;
}

.question-text pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.question-text pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.question-text table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.question-text table th,
.question-text table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
}

.question-text table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--primary-color);
}

.question-text hr {
    border: 0;
    height: 2px;
    background-color: var(--border-color);
    margin: 1.5rem 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3f7a;
}

/* Submission Details Modal */
.bg-light-success {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.bg-light-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.border-success {
    border-color: #198754 !important;
}

.border-danger {
    border-color: #dc3545 !important;
}

/* Print Styles */
@media print {
    .navbar, .btn, .modal, .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    body {
        background-color: white !important;
    }
}
