/**
 * AI Awards Evaluation System - Custom Styles
 * Bootstrap 5.3 extensions and overrides
 */

/* =============================================================================
   CSS Custom Properties (PRD Color Palette)
   ============================================================================= */
:root {
    --awards-primary: #0d6efd;
    --awards-secondary: #6c757d;
    --awards-success: #198754;
    --awards-danger: #dc3545;
    --awards-warning: #ffc107;
    --awards-info: #0dcaf0;
    --awards-light: #f8f9fa;
    --awards-dark: #212529;

    --navbar-height: 56px;
    --footer-height: 50px;
}

/* =============================================================================
   Layout
   ============================================================================= */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* =============================================================================
   Navigation
   ============================================================================= */
.navbar {
    min-height: var(--navbar-height);
}

.navbar-brand {
    font-weight: 600;
}

.navbar .dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* =============================================================================
   Cards
   ============================================================================= */
.card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* =============================================================================
   Tables
   ============================================================================= */
.table > :not(caption) > * > * {
    padding: 0.75rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* =============================================================================
   Buttons
   ============================================================================= */
.btn {
    font-weight: 500;
}

.btn-group > .btn {
    border-radius: 0.375rem;
}

.btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

/* =============================================================================
   Forms
   ============================================================================= */
.form-control:focus,
.form-select:focus {
    border-color: var(--awards-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.375rem;
}

/* =============================================================================
   Progress Bar
   ============================================================================= */
.progress {
    border-radius: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.3s ease-in-out;
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* =============================================================================
   Wizard Steps
   ============================================================================= */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--awards-secondary);
    min-width: 80px;
}

.step-indicator.active {
    color: var(--awards-primary);
}

.step-indicator.completed {
    color: var(--awards-success);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.step-indicator.active .step-number {
    background: var(--awards-primary);
    color: white;
    transform: scale(1.1);
}

.step-indicator.completed .step-number {
    background: var(--awards-success);
    color: white;
}

.step-label {
    font-size: 0.8rem;
    text-align: center;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 0.5rem;
    margin-bottom: 2rem;
    min-width: 50px;
}

/* =============================================================================
   HTMX Indicators
   ============================================================================= */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Loading overlay */
.htmx-request .loading-overlay {
    display: flex !important;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

/* =============================================================================
   Alerts
   ============================================================================= */
.alert {
    border-radius: 0.5rem;
}

.messages-container .alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   Badges
   ============================================================================= */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* =============================================================================
   Accordion
   ============================================================================= */
.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--awards-primary);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* =============================================================================
   Modal
   ============================================================================= */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   Sortable Table Headers
   ============================================================================= */
.sortable-header {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.sortable-header:hover {
    color: var(--bs-primary);
}

/* =============================================================================
   Expandable Table Rows
   ============================================================================= */
.result-row {
    cursor: pointer;
}

.detail-row td {
    padding: 0 !important;
}

.toggle-detail i {
    transition: transform 0.2s ease;
}

/* =============================================================================
   Code/Pre
   ============================================================================= */
pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
}

code {
    color: #d63384;
}

pre code {
    color: inherit;
}

/* =============================================================================
   Utilities
   ============================================================================= */
.font-monospace {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.cursor-pointer {
    cursor: pointer;
}

.min-vh-50 {
    min-height: 50vh;
}

/* =============================================================================
   Responsive Adjustments
   ============================================================================= */
@media (max-width: 768px) {
    .step-indicator {
        min-width: 60px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* =============================================================================
   Print Styles
   ============================================================================= */
@media print {
    .navbar,
    .footer,
    .btn,
    .breadcrumb {
        display: none !important;
    }

    body {
        padding-top: 0 !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
