/* Modern UI Styles for Recruiting Application */

/* Root variables for consistent theming */
:root {
    --primary-color: #FFD232;
    --primary-dark: #e6bd2d;
    --primary-light: #FFD232;
    --secondary-color: #FFD232;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

/* Typography improvements */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
    background-color: var(--gray-100);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

/* Modern Cards */
.card {
    border: none !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
    transition: all var(--transition-normal);
    overflow: hidden;
    background: white;
}

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

.card-header {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    border-bottom: none !important;
}

.card-header h3, .card-header h4, .card-header h5 {
    color: white;
    margin-bottom: 0;
}

/* Fix for light background card headers */
.card-header.bg-white,
.card-header.bg-light {
    color: #212529 !important;
    border-bottom: 1px solid rgba(0,0,0,.125) !important;
}

.card-header.bg-white {
    background: #ffffff !important;
}

.card-header.bg-light {
    background: #f8f9fa !important;
}

.card-header.bg-white h3, .card-header.bg-white h4, .card-header.bg-white h5, .card-header.bg-white h6,
.card-header.bg-light h3, .card-header.bg-light h4, .card-header.bg-light h5, .card-header.bg-light h6 {
    color: #212529 !important;
}

.card-header.border-0 {
    border-bottom: none !important;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-fast);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #212529 0%, #000000 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.25);
}

.btn-dark {
    background: linear-gradient(135deg, #212529 0%, #000000 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

/* Responsive tweaks for hero/cards/buttons */
@media (max-width: 992px) {
    .hero-section .row {
        gap: 1.5rem;
    }
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    .btn-group-mobile .btn {
        width: 100%;
    }
    .vacancy-card .card-footer {
        margin-top: auto;
    }
    .vacancy-card .requirements .badge {
        white-space: normal;
    }
}

@media (max-width: 576px) {
    .hero-section .display-4,
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .hero-section .lead {
        font-size: 1rem;
    }
    .vacancy-card .card-footer .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
    .vacancy-card .meta-item {
        align-items: flex-start;
    }
}

.btn-dark:hover {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
    color: white;
}

/* btn-warning uses Bootstrap default yellow style */

.btn-outline-primary {
    background: transparent;
    border: 2px solid #212529;
    color: #212529;
}

.btn-outline-primary:hover {
    background: #212529;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

.btn-outline-warning {
    background: transparent;
    border: 2px solid #212529;
    color: #212529;
}

.btn-outline-warning:hover {
    background: #212529;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

/* Modern Forms */
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 0.625rem 0.875rem;
    transition: all var(--transition-fast);
    background-color: white;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Modern Tables */
.table {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.table thead th {
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

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

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Modern Navigation */
.navbar {
    background: white !important;
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
}

.navbar-brand img {
    height: 45px;
    transition: all var(--transition-normal);
}

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

.nav-link {
    color: var(--gray-600) !important;
    font-weight: 500;
    padding: 0.625rem 1rem !important;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-color) !important;
}

/* Modern Badges */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

/* AI Evaluation Card */
.ai-evaluation-card {
    border: none;
    border-radius: var(--border-radius-lg);
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
}

.ai-score {
    font-size: 3rem;
    font-weight: 700;
}

.ai-confidence {
    opacity: 0.9;
}

/* File Upload Component */
.file-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    transition: all var(--transition-normal);
    background: var(--gray-50);
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

/* File List Items */
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    transition: all var(--transition-fast);
}

.file-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
}

/* Progress Bars */
.progress {
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--gray-200);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

/* Modern Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* Modern Modals */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    border-bottom: none;
}

.modal-title {
    color: white;
    font-weight: 600;
}

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

/* Status Pills */
.status-pill {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-normal);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .file-upload-area {
        padding: 2rem;
    }

    .navbar {
        padding: 0.75rem 0;
    }
}

/* SweetAlert Button Styles - Larger and more visible */
.sweet-alert button {
    font-size: 1.1rem !important;
    padding: 12px 32px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    min-width: 140px !important;
    margin: 8px !important;
    text-transform: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    transition: all 0.2s ease !important;
}

.sweet-alert button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.sweet-alert button.confirm {
    background-color: #198754 !important;
    color: white !important;
}

.sweet-alert button.confirm:hover {
    background-color: #157347 !important;
}

.sweet-alert button.cancel {
    background-color: #6c757d !important;
    color: white !important;
}

.sweet-alert button.cancel:hover {
    background-color: #5c636a !important;
}

.sweet-alert h2 {
    font-size: 1.5rem !important;
    color: var(--gray-800) !important;
    margin-bottom: 1rem !important;
}

.sweet-alert p {
    font-size: 1.1rem !important;
    color: var(--gray-600) !important;
}

.sweet-alert .sa-button-container {
    margin-top: 1.5rem !important;
}

/* Fix #3, #4, #8 - Button and Header Visibility */

/* Warning buttons - better contrast with border */
.btn-warning {
    color: #000 !important;
    font-weight: 600 !important;
    border: 2px solid #d4a000 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
    background-color: #ffc107 !important;
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #e6a700 !important;
    color: #000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

/* Card headers - solid color for visibility */
.card-header {
    background-color: #FEA939 !important;
    color: #000 !important;
    font-weight: 600 !important;
    padding: 0.875rem 1.25rem !important;
    border-bottom: 2px solid #e69500 !important;
}

.card-header h5,
.card-header h6,
.card-header .mb-0,
.card-header span {
    color: #000 !important;
    font-weight: 700 !important;
}

/* Modal headers - ensure visibility */
.modal-header {
    background-color: #FEA939 !important;
    color: #000 !important;
}

.modal-header .modal-title {
    color: #000 !important;
    font-weight: 700 !important;
}

.modal-header .btn-close {
    filter: none !important;
    opacity: 0.8 !important;
}

/* Education, Work, Documents sections - gradient headers */
#EducationList .card-header,
#WorkExperienceList .card-header,
#DocumentsList .card-header,
.card-header.bg-warning {
    background: linear-gradient(135deg, #FEA939 0%, #FFD232 100%) !important;
    color: #000 !important;
    font-size: 1.05rem !important;
}

/* User profile card header */
.card-header.bg-warning.bg-opacity-10 {
    background: #FEA939 !important;
    opacity: 1 !important;
}

/* Responsive table → cards on <lg screens */
@media (max-width: 991.98px) {
    .responsive-cards-table { border: 0; }
    .responsive-cards-table thead { display: none; }
    .responsive-cards-table, .responsive-cards-table tbody, .responsive-cards-table tr, .responsive-cards-table td, .responsive-cards-table th {
        display: block;
        width: 100%;
    }
    .responsive-cards-table tr {
        border: 1px solid #dee2e6;
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 10px 12px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }
    .responsive-cards-table td, .responsive-cards-table th {
        border: 0;
        padding: 6px 0;
    }
    .responsive-cards-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.8rem;
        color: #6c757d;
        text-transform: uppercase;
        margin-bottom: 4px;
    }
}

/* Geoname selectors: Bootstrap dropdown + select2 inside */
.input-group > .dropdown-menu {
    overflow: visible;
}
.select2-container--open {
    z-index: 10000 !important;
}
.select2-dropdown {
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-radius: 0.375rem;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
    color: #000 !important;
}

@media (max-width: 991.98px) {
    .input-group > .dropdown-menu {
        width: 100% !important;
        min-width: 100% !important;
        max-width: calc(100vw - 1rem);
    }
    .input-group > .dropdown-menu .select2-container,
    .input-group > .dropdown-menu .form-select {
        width: 100% !important;
    }
    .select2-container--open .select2-dropdown {
        max-width: calc(100vw - 1rem);
    }
}
