/* ========================================
   KODUESI - CUSTOM STYLESHEET
   ======================================== */

/* 1. CSS Custom Properties (Design Tokens) */
:root {
    /* Primary Colors */
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #6ea8fe;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Background Colors */
    --body-bg: #f8f9fa;
    --card-bg: #ffffff;
    --navbar-bg: #0d6efd;
    --footer-bg: #f8f9fa;

    /* Text Colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #8898aa;
    --text-white: #ffffff;

    /* Border & Shadow */
    --border-color: #dee2e6;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-sm: 0.25rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-weight-normal: 400;
    --font-weight-bold: 600;

    /* Transitions */
    --transition-base: all 0.2s ease-in-out;
    --transition-fast: all 0.1s ease-in-out;

    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* 2. Base Typography */
html {
  font-size: 16px; /* Increase from 14px for better accessibility */
  scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--body-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100%;
    margin-bottom: 60px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive Typography */
@media (max-width: 768px) {
    html { font-size: 14px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* 3. Component Styles - Buttons */
.btn {
    font-weight: var(--font-weight-bold);
    border-radius: var(--border-radius);
    padding: 0.5rem 1.25rem;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
}

.btn:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon i {
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: var(--font-size-lg);
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.65;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* 4. Layout - Navbar */
/* Navbar Styling */
.navbar {
    padding: 0.75rem 0;
    transition: var(--transition-base);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    transition: var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand i {
    font-size: 1.75rem;
}

/* Navbar Links - ensure visibility on dark background */
.navbar-dark .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: #ffffff !important;
}

.navbar-dark .nav-link.dropdown-toggle {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-dark .nav-link i {
    opacity: 0.9;
}

.navbar-dark .nav-link:hover i {
    opacity: 1;
}

.dropdown-menu {
    background-color: #ffffff !important;
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
    z-index: 9999 !important;
}

.dropdown-item {
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    color: var(--text-primary) !important;
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: var(--primary-color) !important;
    color: var(--text-white) !important;
}

.dropdown-item:focus {
    background-color: var(--primary-color) !important;
    color: var(--text-white) !important;
}

.dropdown-item:active {
    background-color: var(--primary-dark) !important;
    color: var(--text-white) !important;
}

.dropdown-item i {
    width: 1.25rem;
}

.dropdown-divider {
    margin: 0.5rem 0;
}

/* Footer Styling */
.footer {
    background-color: var(--footer-bg);
    margin-top: var(--spacing-xl);
    margin-bottom: -60px;
    padding-top: var(--spacing-md) !important;
    padding-bottom: var(--spacing-md) !important;
}

.footer .container > div {
    flex-wrap: nowrap !important;
    gap: 1rem !important;
}

.footer p {
    margin-bottom: 0 !important;
    white-space: nowrap;
}

.footer a {
    transition: var(--transition-fast);
    white-space: nowrap;
}

.footer a:hover {
    color: var(--primary-color) !important;
}

.footer-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: center;
}

@media (max-width: 768px) {
    .footer {
        font-size: 0.75rem;
    }

    .footer-links {
        gap: 0.5rem;
    }

    .footer a {
        font-size: 0.75rem;
    }

    .footer .me-3 {
        margin-right: 0.5rem !important;
    }
}

/* Pagination Styling */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 0.5rem 0.75rem;
    transition: var(--transition-fast);
    font-weight: 500;
}

.page-link:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--text-white);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
}

.page-item.disabled .page-link {
    background-color: var(--body-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

@media (max-width: 576px) {
    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: var(--font-size-sm);
    }
}

/* 5. Page-Specific Styles - Home Page */
/* Home Page Specific Styles */
.hero-section {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.1) 100%);
    border-radius: var(--border-radius-lg);
}

.hero-icon {
    font-size: 4rem;
    color: var(--primary-color);
}

.info-card {
    transition: var(--transition-base);
}

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

.info-card-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

.news-content {
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

/* Arena Page Specific Styles */
.arena-container {
    min-height: 80vh;
}

#problem-container {
    max-height: 70vh;
    overflow-y: auto;
}

#problem-container::-webkit-scrollbar {
    width: 8px;
}

#problem-container::-webkit-scrollbar-track {
    background: var(--body-bg);
    border-radius: var(--border-radius);
}

#problem-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius);
}

#problem-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.ace_editor {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    font-size: 14px !important;
}

@media (max-width: 992px) {
    .arena-container .col-lg-6 {
        margin-bottom: var(--spacing-lg);
    }

    #problem-container {
        max-height: 50vh;
    }
}

/* RankList Page Specific Styles */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 1.25rem;
    font-weight: var(--font-weight-bold);
    font-size: 0.875rem;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #212529;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: #212529;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: white;
}

.rank-number {
    font-size: 1.125rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-secondary);
}

.sidebar .card {
    margin-bottom: 1rem;
}

.sidebar .card-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: 500;
}

.contest-status {
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.problem-difficulty-stars {
    color: #ffc107;
}

/* Badge & Status Consistency */
.badge {
    border-radius: 1.25rem;
    padding: 0.375rem 0.875rem;
    font-weight: var(--font-weight-bold);
    font-size: 0.8125rem;
    display: inline-block;
}

/* Status Result Badges */
.status-badge {
    border-radius: 1.25rem;
    padding: 0.375rem 0.875rem;
    font-weight: var(--font-weight-bold);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.status-accepted {
    background-color: #28a745;
    color: white;
}

.status-wrong-answer {
    background-color: #dc3545;
    color: white;
}

.status-time-limit {
    background-color: #ffc107;
    color: #212529;
}

.status-memory-limit {
    background-color: #fd7e14;
    color: white;
}

.status-runtime-error {
    background-color: #6f42c1;
    color: white;
}

.status-compile-error {
    background-color: #e83e8c;
    color: white;
}

.status-pending {
    background-color: #6c757d;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.status-judging {
    background-color: #17a2b8;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.news-card {
    transition: transform 0.2s ease-in-out;
    border: 1px solid #e9ecef;
}

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

.practice-category {
    transition: background-color 0.2s ease;
}

.practice-category:hover {
    background-color: #f8f9fa;
}

.practice-category.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.stats-card {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
}

.ranking-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.ranking-table th {
    background: #f8f9fa;
    border: none;
    color: #495057;
    font-weight: 600;
}

.ranking-table td {
    border: none;
    border-bottom: 1px solid #f1f3f4;
    padding: 12px 8px;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    line-height: 60px;
    background-color: #f5f5f5;
}

/* Validation styles */
.validation-summary-errors,
.field-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
}

.field-validation-error {
    display: block;
    margin-top: 5px;
}

/* Social login partial */
.social-login-partial {
    margin-top: 20px;
}

.social-login-partial h3 {
    margin-bottom: 15px;
}

#socialLoginList button {
    margin-right: 10px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#socialLoginList button i {
    font-size: 1.2rem;
}

/* Alert styles */
.alert {
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.alert .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.5;
    cursor: pointer;
    float: right;
}

.alert .close:hover {
    opacity: 0.75;
}

/* Button styles enhancement */
.btn-large {
    padding: 10px 20px;
    font-size: 1rem;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.875rem;
}

/* Card Consistency */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    transition: var(--transition-base);
    background-color: var(--card-bg);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    font-weight: var(--font-weight-bold);
    padding: var(--spacing-lg);
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    color: var(--text-white);
    margin: 0;
    font-size: 1.5rem;
}

.card-header .btn {
    margin-left: auto;
}

.card-body {
    padding: var(--spacing-xl);
}

.card-footer {
    background-color: var(--body-bg);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-xl);
}

/* Card Variants */
.card-success .card-header {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
}

.card-danger .card-header {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
}

.card-info .card-header {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
}

.card-warning .card-header {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    color: var(--text-primary);
}

.card-warning .card-header h1,
.card-warning .card-header h2,
.card-warning .card-header h3,
.card-warning .card-header h4,
.card-warning .card-header h5 {
    color: var(--text-primary);
}

/* Sidebar Card Styles */
.sidebar .card {
    margin-bottom: var(--spacing-md);
}

/* Table Consistency */
.table {
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--card-bg);
}

.table thead th {
    background-color: var(--body-bg);
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody td {
    padding: var(--spacing-md);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    cursor: pointer;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Responsive Table Wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
}

/* Mobile Table Optimization */
@media (max-width: 768px) {
    .table thead th,
    .table tbody td {
        padding: var(--spacing-sm);
        font-size: var(--font-size-sm);
    }

    .table-mobile-hide {
        display: none;
    }
}

/* Form Consistency */
.form-label {
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    display: block;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.625rem 0.875rem;
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
    background-color: var(--card-bg);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

.form-text {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

/* Filter Forms */
.filter-form {
    background-color: var(--body-bg);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--spacing-xl);
}

.filter-form .row {
    row-gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .filter-form .col-md-2,
    .filter-form .col-md-3 {
        width: 100%;
    }
}

/* Modal Consistency */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: var(--spacing-lg);
    border-bottom: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-title {
    font-weight: var(--font-weight-bold);
    font-size: 1.25rem;
    color: var(--text-white);
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: var(--spacing-xl);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md) var(--spacing-xl);
}

/* Modal Variants */
.modal-success .modal-header {
    background: linear-gradient(135deg, var(--success-color) 0%, #218838 100%);
}

.modal-danger .modal-header {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
}

.modal-warning .modal-header {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
    color: var(--text-primary);
}

.modal-warning .modal-title {
    color: var(--text-primary);
}

/* How-to section styles */
.howto {
    scroll-margin-top: 80px;
}

.howto h2 {
    color: #333;
}

.howto h5 {
    color: #0056b3;
    margin-top: 15px;
}

/* Select styling */
select.input-xlarge {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
}

select.input-xlarge:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Checkbox styling */
fieldset ol li.checkbox {
    display: flex;
    align-items: center;
}

fieldset ol li.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-weight: normal;
}

fieldset ol li.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* External logins table */
#externalLogins .table td {
    vertical-align: middle;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        margin-top: 2rem;
    }
    
    .contest-card .d-flex {
        flex-direction: column;
    }
    
    .contest-card .d-flex > div:last-child {
        margin-top: 1rem;
        text-align: left !important;
    }
    
    .row-fluid {
        flex-direction: column;
    }
    
    .input-xlarge {
        min-width: 100%;
    }
    
    hgroup.title h1 {
        font-size: 1.5rem;
    }
    
    hgroup.title h2 {
        font-size: 1rem;
    }
}

/* jQuery UI Autocomplete z-index fix for modals */
.ui-autocomplete {
    z-index: 1151 !important;
}
/* =============================================
   Arena Practice Page Styles
   ============================================= */

/* Problem container */
.problem-tab {
    min-height: 500px;
}

.problem .resizable {
    position: relative;
    resize: vertical;
    overflow: auto;
    min-height: 200px;
    max-height: 800px;
}

/* Code editor styling */
.resizable-solution {
    position: relative;
    resize: vertical;
    min-height: 300px;
    max-height: 800px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}

.ace_editor {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

/* Language selector */
.PreferredLanguage {
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
}

.PreferredLanguage:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.PreferredLanguage:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Status colors */
.text-accepted,
.text-success-color { color: #28a745 !important; }

.text-wrong-answer,
.text-danger-color { color: #dc3545 !important; }

.text-pending,
.text-warning-color { color: #ffc107 !important; }

.text-time-limit,
.text-memory-limit,
.text-runtime-error,
.text-compile-error { color: #fd7e14 !important; }

/* Solution status table */
#table-solution {
    font-size: 0.95rem;
}

#table-solution thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

#table-solution tbody tr {
    transition: background-color 0.2s ease;
}

#table-solution tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Modal refresh button */
#modalRefreshBtn {
    transition: all 0.3s ease;
}

#modalRefreshBtn:hover {
    transform: rotate(180deg);
}

/* Show/hide problem button */
.show-hide-problem {
    transition: all 0.2s ease;
}

.show-hide-problem i {
    transition: transform 0.2s ease;
}

.show-hide-problem.collapsed i {
    transform: rotate(180deg);
}

/* Panel styling for resizable containers */
.panel {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Execution error popover */
.error-popover {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.error-popover:hover {
    opacity: 0.8;
}

/* Pre code blocks in problem description */
.problem pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    margin: 0.5rem 0;
}

/* Sample input/output styling */
.problem .row > div {
    margin-bottom: 1rem;
}

/* Floating buttons group */
.float-end.btn-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 0.375rem;
}

/* Smooth transitions for all interactive elements */
.btn,
.form-control,
.form-select,
.card,
a {
    transition: all 0.2s ease;
}

/* jQuery UI resizable handle styling */
.ui-resizable-handle {
    background-color: #0d6efd;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ui-resizable:hover .ui-resizable-handle {
    opacity: 0.3;
}

.ui-resizable-s {
    cursor: ns-resize;
    height: 7px;
    width: 100%;
    bottom: -5px;
    left: 0;
}

/* Mobile responsiveness for Arena */
@media (max-width: 768px) {
    .problem .resizable {
        min-height: 150px;
    }
    
    .resizable-solution {
        min-height: 250px;
    }
    
    .float-end.btn-group {
        float: none !important;
        display: flex;
        margin-bottom: 1rem;
    }
    
    .modal-xl {
        max-width: 100%;
        margin: 0;
    }
}

/* Loading spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner.fa-spin,
.icon-spinner.icon-spin {
    animation: spin 1s linear infinite;
}

/* Badge styling improvements */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Card shadow on hover */
.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

/* Text utilities */
.fw-bold {
    font-weight: 700 !important;
}

.text-primary {
    color: #0d6efd !important;
}

/* Scrollbar styling for WebKit browsers */
.resizable::-webkit-scrollbar,
.resizable-solution::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.resizable::-webkit-scrollbar-track,
.resizable-solution::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.resizable::-webkit-scrollbar-thumb,
.resizable-solution::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.resizable::-webkit-scrollbar-thumb:hover,
.resizable-solution::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===============================
   Competition Arena Styles
   =============================== */

/* Competition header with time and status */
#arenaContent .row.mb-4 {
    align-items: center;
}

#time, #competitionStatus {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
}

/* Competition tabs styling */
#arenaTabs .nav-link {
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    border-bottom: 3px solid transparent;
}

#arenaTabs .nav-link:hover {
    color: #0d6efd;
    background-color: #f8f9fa;
}

#arenaTabs .nav-link.active {
    color: #0d6efd;
    background-color: transparent;
    border-bottom: 3px solid #0d6efd;
}

#arenaTabs .nav-link i {
    margin-right: 0.25rem;
}

/* Competition results table */
#table-result table {
    font-size: 0.95rem;
}

#table-result .table-success {
    background-color: #d1e7dd !important;
}

#table-result .table-danger {
    background-color: #f8d7da !important;
}

#table-result th.text-center,
#table-result td.text-center {
    text-align: center;
}

/* Competition status summary */
.alert-info h5 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* LiveBoard specific styles */
.refresh-animation {
    animation: spin 0.5s linear;
}

/* Competition problem tabs */
.problem-tab {
    min-height: 400px;
}

.problem-tab .text-center.py-4 {
    padding: 3rem 1rem;
}

/* Frozen leaderboard alert */
.alert-warning .fas.fa-snowflake {
    color: #ffc107;
}

/* Competition not started message */
.fa-hourglass-start {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 6. Utilities - Loading States */
.loading-state {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.no-horizontal-padding {
    padding-left: 0px !important;
    padding-right: 0px !important;
}

/* Mobile-First Responsive Utilities */
@media (max-width: 768px) {
    .container,
    .container-fluid {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }

    .card-body {
        padding: var(--spacing-md);
    }

    .card-header {
        padding: var(--spacing-md);
    }

    .mobile-hide {
        display: none !important;
    }
}

/* Button Stacking on Mobile */
@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* Modal Full Screen on Mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
    }
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
    }

    .page-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Mobile Navigation Enhancement */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: rgba(13, 110, 253, 0.95);
        margin-top: 1rem;
        padding: 1rem;
        border-radius: var(--border-radius-lg);
    }

    .navbar-nav {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: var(--border-radius);
    }

    .dropdown-menu {
        background-color: rgba(255, 255, 255, 0.1);
        border: none;
    }
}

/* Print styles for LiveBoard */
@media print {
    .hidden-print {
        display: none !important;
    }

    .table-success {
        background-color: #d1e7dd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .table-danger {
        background-color: #f8d7da !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
