/**
 * Apply Mode Styles
 * Premium application process interface
 * Phase 1: Foundation styles
 */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --apply-primary: #C9A961;
    --apply-primary-dark: #B8935A;
    --apply-success: #4CAF50;
    --apply-warning: #FF9800;
    --apply-danger: #F44336;
    --apply-dark: #1A3028;
    --apply-gray: #6B7280;
    --apply-light-gray: #F3F4F6;
    --apply-white: #FFFFFF;
    --apply-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --apply-border: rgba(0, 0, 0, 0.08);
    --apply-radius: 12px;
    --apply-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   APPLY BUTTON IN SENNA ULTIMATE
   ============================================ */
.ultimate-apply-section {
    margin-top: 32px;
    padding: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(201, 169, 97, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(201, 169, 97, 0.15);
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.ultimate-apply-prompt h4 {
    font-size: 24px;
    font-weight: 600;
    color: var(--apply-dark);
    margin: 0 0 12px 0;
    font-family: 'Playfair Display', serif;
}

.ultimate-apply-prompt p {
    font-size: 16px;
    color: var(--apply-gray);
    margin: 0 0 24px 0;
}

.ultimate-apply-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--apply-primary), var(--apply-primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--apply-transition);
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.3);
}

.ultimate-apply-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(201, 169, 97, 0.4);
    background: linear-gradient(135deg, var(--apply-primary-dark), var(--apply-primary));
}

.ultimate-apply-button:active {
    transform: translateY(0);
}

.apply-icon {
    font-size: 20px;
}

.apply-arrow {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.ultimate-apply-button:hover .apply-arrow {
    transform: translateX(4px);
}

.ultimate-apply-alternatives {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
}

.ultimate-alt-action {
    padding: 10px 20px;
    background: transparent;
    color: var(--apply-gray);
    border: 1px solid var(--apply-border);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--apply-transition);
}

.ultimate-alt-action:hover {
    background: var(--apply-light-gray);
    color: var(--apply-dark);
    border-color: var(--apply-primary);
}

/* ============================================
   INTEGRATED SECTION WITHIN WRAPPER
   ============================================ */
.apply-mode-section {
    position: fixed; /* Changed to fixed to ensure full coverage */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    background: rgb(255, 255, 247);
    z-index: 9999; /* Increased z-index to be above everything */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Container doesn't scroll, content does */
}

/* When Apply Mode is active */
.sffc-opportunities-wrapper.apply-mode-active {
    overflow: hidden;
}

.sffc-opportunities-wrapper.apply-mode-active .sffc-conversational-view {
    display: none;
}

.sffc-opportunities-wrapper.apply-mode-active .senna-ultimate-container {
    display: none;
}

/* ============================================
   PANEL - Fullscreen
   ============================================ */
.apply-mode-panel {
    width: 100%;
    height: 100%;
    background: rgb(255, 255, 247);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10000; /* Very high z-index to prevent bleed-through */
}

/* ============================================
   HEADER
   ============================================ */
.apply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px; /* Reduced padding */
    background: white;
    border-bottom: 1px solid var(--apply-border);
    position: relative; /* Changed from sticky */
    z-index: 100;
    flex-shrink: 0; /* Prevent shrinking */
}

.apply-header-left,
.apply-header-right {
    flex: 0 0 auto;
}

.apply-header-center {
    flex: 1;
    text-align: center;
}

.apply-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    color: var(--apply-gray);
    border: 1px solid var(--apply-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--apply-transition);
}

.apply-back-btn:hover {
    background: var(--apply-light-gray);
    color: var(--apply-dark);
}

.apply-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--apply-dark);
    margin: 0 0 4px 0;
    font-family: 'Inter', sans-serif;
}

.apply-job-info {
    font-size: 14px;
    color: var(--apply-gray);
}

.apply-separator {
    margin: 0 8px;
    opacity: 0.5;
}

.apply-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--apply-gray);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: var(--apply-transition);
}

.apply-close-btn:hover {
    background: var(--apply-light-gray);
    color: var(--apply-dark);
}

/* ============================================
   PROGRESS
   ============================================ */
.apply-progress {
    padding: 16px 30px; /* Reduced padding */
    background: linear-gradient(to bottom, #FAFAFA, transparent);
    flex-shrink: 0; /* Prevent shrinking */
}

.apply-progress-bar {
    height: 4px;
    background: var(--apply-light-gray);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

.apply-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--apply-primary), var(--apply-primary-dark));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.apply-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 16px; /* Reduced from 24px */
}

.apply-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* Reduced gap */
    opacity: 0.5;
    transition: var(--apply-transition);
}

.apply-step.active {
    opacity: 1;
}

.apply-step.complete {
    opacity: 1;
}

.step-dot {
    width: 24px; /* Reduced size */
    height: 24px; /* Reduced size */
    border: 2px solid var(--apply-border);
    border-radius: 50%;
    background: white;
    position: relative;
    transition: var(--apply-transition);
}

.apply-step.active .step-dot {
    border-color: var(--apply-primary);
    background: var(--apply-primary);
}

.apply-step.complete .step-dot {
    border-color: var(--apply-success);
    background: var(--apply-success);
}

.apply-step.complete .step-dot::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--apply-gray);
}

.apply-step.active .step-label {
    color: var(--apply-dark);
    font-weight: 600;
}

/* ============================================
   CONTENT
   ============================================ */
.apply-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px;
    width: 100%;
    height: 100%; /* Ensure full height */
    position: relative;
    background: rgb(255, 255, 247);
    z-index: 1;
}

.apply-content > * {
    max-width: 1200px;
    margin: 0 auto;
}

.apply-phase-container {
    animation: fadeIn 0.3s ease;
}

/* Preparation Phase */
.apply-prep-intro {
    text-align: center;
    margin-bottom: 32px;
}

.apply-prep-intro h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--apply-dark);
    margin: 0 0 8px 0;
}

.apply-prep-intro p {
    font-size: 16px;
    color: var(--apply-gray);
    margin: 0;
}

.apply-readiness-card {
    background: white;
    border: 1px solid var(--apply-border);
    border-radius: var(--apply-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.apply-readiness-card h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--apply-dark);
    margin: 0 0 24px 0;
}

.readiness-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.score-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-circle svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--apply-light-gray);
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: var(--apply-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 600;
    color: var(--apply-dark);
}

.score-label {
    margin-top: 12px;
    font-size: 14px;
    color: var(--apply-gray);
}

.readiness-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--apply-light-gray);
    border-radius: 8px;
    transition: var(--apply-transition);
}

.checklist-item.complete {
    background: rgba(76, 175, 80, 0.1);
}

.check-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--apply-gray);
}

.checklist-item.complete .check-icon {
    color: var(--apply-success);
    font-weight: bold;
}

.check-label {
    font-size: 15px;
    color: var(--apply-dark);
}

.readiness-warning,
.readiness-success {
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
}

.readiness-warning {
    background: rgba(255, 152, 0, 0.1);
    color: var(--apply-warning);
}

.readiness-success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--apply-success);
}

.btn-edit-profile {
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--apply-warning);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--apply-transition);
}

.btn-edit-profile:hover {
    background: #F57C00;
}

.apply-job-match {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.05), rgba(201, 169, 97, 0.1));
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: var(--apply-radius);
    padding: 24px;
    text-align: center;
}

.apply-job-match h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--apply-dark);
    margin: 0 0 16px 0;
}

.match-score {
    font-size: 36px;
    font-weight: 700;
    color: var(--apply-primary);
    margin-bottom: 12px;
}

.apply-job-match p {
    font-size: 15px;
    color: var(--apply-gray);
    margin: 0;
}

/* Placeholder Phases */
.phase-placeholder {
    text-align: center;
    padding: 48px;
    color: var(--apply-gray);
}

.phase-placeholder h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--apply-dark);
    margin: 0 0 16px 0;
}

.phase-placeholder ul {
    text-align: left;
    display: inline-block;
    margin-top: 24px;
}

/* ============================================
   FOOTER
   ============================================ */
.apply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px; /* Reduced padding */
    border-top: 1px solid var(--apply-border);
    background: white;
    position: relative; /* Changed from sticky */
    z-index: 100;
    flex-shrink: 0; /* Prevent shrinking */
}

.apply-footer-left,
.apply-footer-right {
    display: flex;
    gap: 12px;
}

.apply-save-draft {
    padding: 10px 20px;
    background: transparent;
    color: var(--apply-gray);
    border: 1px solid var(--apply-border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--apply-transition);
}

.apply-save-draft:hover {
    background: white;
    color: var(--apply-dark);
}

.apply-prev-btn,
.apply-next-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--apply-transition);
}

.apply-prev-btn {
    background: var(--apply-light-gray);
    color: var(--apply-dark);
}

.apply-prev-btn:hover {
    background: #E5E7EB;
}

.apply-next-btn {
    background: var(--apply-primary);
    color: white;
}

.apply-next-btn:hover {
    background: var(--apply-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.apply-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--apply-shadow);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.apply-notification.success {
    border-left: 4px solid var(--apply-success);
    color: var(--apply-success);
}

.apply-notification.error {
    border-left: 4px solid var(--apply-danger);
    color: var(--apply-danger);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .apply-mode-section {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .apply-header {
        padding: 20px;
    }
    
    .apply-progress {
        padding: 20px;
    }
    
    .apply-content {
        padding: 20px;
    }
    
    .apply-footer {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
    }
    
    .apply-footer-left,
    .apply-footer-right {
        width: 100%;
    }
    
    .apply-footer-right {
        justify-content: space-between;
    }
    
    .apply-prev-btn,
    .apply-next-btn {
        flex: 1;
    }
    
    .apply-progress-steps {
        gap: 8px;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .step-dot {
        width: 24px;
        height: 24px;
    }
}