* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
}

header h1 {
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* Position Selector */
.position-selector {
    margin-bottom: 20px;
}

.position-dropdowns {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.dropdown-group label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.dropdown-group select {
    padding: 10px 12px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.dropdown-group select:focus {
    outline: 2px solid rgba(255,255,255,0.5);
}

.interview-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.form-group input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

.score-summary {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.total-score {
    font-size: 1.5rem;
    font-weight: bold;
}

.recommendation {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
}

.recommendation.strong-yes {
    background-color: #27ae60;
    color: white;
}

.recommendation.yes {
    background-color: #2ecc71;
    color: white;
}

.recommendation.maybe {
    background-color: #f39c12;
    color: white;
}

.recommendation.no {
    background-color: #e74c3c;
    color: white;
}

.actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

/* Category sections */
.category {
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.category-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.category-header:hover {
    background: #2c3e50;
}

.category-header h2 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-score {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.collapse-icon {
    transition: transform 0.3s;
}

.category.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.category-content {
    padding: 20px;
    display: block;
}

.category.collapsed .category-content {
    display: none;
}

/* Question cards */
.question-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    background: #fafafa;
}

.question-card:last-child {
    margin-bottom: 0;
}

.question-number {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: #2c3e50;
}

.guidance-section {
    margin-bottom: 15px;
}

.guidance-toggle {
    background: none;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 10px;
    margin-bottom: 10px;
}

.guidance-toggle:hover {
    background: #3498db;
    color: white;
}

.guidance-toggle.active {
    background: #3498db;
    color: white;
}

.guidance-content {
    display: none;
    margin-top: 10px;
    padding: 15px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.guidance-content.visible {
    display: block;
}

.expected-answers {
    background: #e8f6e8;
    border-left: 4px solid #27ae60;
}

.red-flags {
    background: #fce8e8;
    border-left: 4px solid #e74c3c;
}

.guidance-content h4 {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.guidance-content ul {
    margin-left: 20px;
}

.guidance-content li {
    margin-bottom: 5px;
}

/* Scoring */
.scoring-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.score-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-input label {
    font-weight: 500;
}

.score-buttons {
    display: flex;
    gap: 5px;
}

.score-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.score-btn:hover {
    border-color: #3498db;
}

.score-btn.selected {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.score-btn.score-1.selected { background: #e74c3c; border-color: #e74c3c; }
.score-btn.score-2.selected { background: #e67e22; border-color: #e67e22; }
.score-btn.score-3.selected { background: #f39c12; border-color: #f39c12; }
.score-btn.score-4.selected { background: #2ecc71; border-color: #2ecc71; }
.score-btn.score-5.selected { background: #27ae60; border-color: #27ae60; }

.notes-section {
    flex: 1;
    min-width: 250px;
}

.notes-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.notes-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

/* Red flag checkbox */
.red-flag-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e74c3c;
    font-weight: 500;
}

.red-flag-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Print styles */
@media print {
    .actions, .guidance-toggle {
        display: none;
    }

    .category.collapsed .category-content {
        display: block;
    }

    .guidance-content {
        display: block !important;
    }
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-box h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-box p {
    color: #7f8c8d;
    margin-bottom: 25px;
}

.login-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-box input[type="password"] {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
}

.login-box .btn {
    padding: 15px;
    font-size: 1.1rem;
}

.login-error {
    color: #e74c3c;
    margin-top: 15px;
    font-size: 0.9rem;
    min-height: 20px;
}

.login-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.login-footer a {
    color: #3498db;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Header with subscription info */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-top h1 {
    margin-bottom: 0;
}

.subscription-info {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.85rem;
}

.subscription-info.expiring-soon {
    background: rgba(241, 196, 15, 0.3);
}

/* Loading state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Questions Answered Counter */
.questions-answered {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* Complete Interview Button */
.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    color: #2c3e50;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Summary Modal Specific */
.summary-candidate {
    text-align: center;
    margin-bottom: 25px;
}

.summary-candidate h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.summary-candidate p {
    margin: 3px 0;
    color: #666;
}

.summary-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.summary-score-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.summary-score-box.highlight {
    background: #3498db;
    color: white;
}

.score-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.score-value {
    font-size: 1.4rem;
    font-weight: bold;
}

.summary-recommendation {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.recommendation-badge {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 10px 25px;
    border-radius: 25px;
    display: inline-block;
    margin-bottom: 10px;
}

.recommendation-badge.strong-hire {
    background: #27ae60;
    color: white;
}

.recommendation-badge.hire {
    background: #2ecc71;
    color: white;
}

.recommendation-badge.maybe {
    background: #f39c12;
    color: white;
}

.recommendation-badge.no-hire {
    background: #e74c3c;
    color: white;
}

.recommendation-badge.insufficient {
    background: #95a5a6;
    color: white;
}

.recommendation-text {
    color: #666;
    font-size: 0.95rem;
}

.summary-red-flags {
    background: #fef5f5;
    border: 1px solid #f8d7da;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.summary-red-flags h4 {
    color: #e74c3c;
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.summary-red-flags ul {
    margin: 0;
    padding-left: 20px;
    color: #721c24;
}

.summary-red-flags li {
    margin-bottom: 5px;
}

.summary-notes {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.summary-notes h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.summary-notes .note-item {
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 8px;
    border-left: 3px solid #3498db;
}

.summary-notes .note-question {
    font-weight: 500;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.summary-notes .note-text {
    color: #2c3e50;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    .score-summary {
        flex-direction: column;
        text-align: center;
    }

    .scoring-section {
        flex-direction: column;
    }

    .header-top {
        flex-direction: column;
        text-align: center;
    }

    .position-dropdowns {
        flex-direction: column;
        gap: 15px;
    }

    .dropdown-group {
        min-width: 100%;
    }
}

/* ==================== Saved Interviews Modal ==================== */
.saved-interviews-modal {
    max-width: 900px;
    width: 95%;
}

.saved-interviews-filters {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.saved-interviews-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.saved-interviews-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    min-width: 150px;
}

.saved-interviews-list {
    max-height: 400px;
    overflow-y: auto;
}

.saved-interview-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    transition: all 0.2s;
}

.saved-interview-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.saved-interview-item.selected {
    border-color: #3498db;
    background: #f0f7ff;
}

.saved-interview-checkbox {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.saved-interview-info {
    flex: 1;
}

.saved-interview-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.saved-interview-details {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #666;
    flex-wrap: wrap;
}

.saved-interview-score {
    text-align: right;
    min-width: 100px;
}

.saved-interview-percentage {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.saved-interview-percentage.high { color: #27ae60; }
.saved-interview-percentage.medium { color: #f39c12; }
.saved-interview-percentage.low { color: #e74c3c; }

.saved-interview-recommendation {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.saved-interview-recommendation.strong-hire { background: #d4edda; color: #155724; }
.saved-interview-recommendation.hire { background: #cce5ff; color: #004085; }
.saved-interview-recommendation.maybe { background: #fff3cd; color: #856404; }
.saved-interview-recommendation.no-hire { background: #f8d7da; color: #721c24; }

.saved-interview-actions {
    display: flex;
    gap: 10px;
    margin-left: 15px;
}

.saved-interview-actions button {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.no-interviews {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ==================== Comparison Modal ==================== */
.comparison-modal {
    max-width: 1200px;
    width: 95%;
}

.comparison-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.comparison-card {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.comparison-card.best {
    border-color: #27ae60;
}

.comparison-card-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 15px;
    text-align: center;
}

.comparison-card.best .comparison-card-header {
    background: linear-gradient(135deg, #1e8449, #27ae60);
}

.comparison-card-header h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.comparison-card-header p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.comparison-card-body {
    padding: 15px;
}

.comparison-score-summary {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.comparison-percentage {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.comparison-percentage.high { color: #27ae60; }
.comparison-percentage.medium { color: #f39c12; }
.comparison-percentage.low { color: #e74c3c; }

.comparison-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 10px;
}

.comparison-badge.strong-hire { background: #d4edda; color: #155724; }
.comparison-badge.hire { background: #cce5ff; color: #004085; }
.comparison-badge.maybe { background: #fff3cd; color: #856404; }
.comparison-badge.no-hire { background: #f8d7da; color: #721c24; }

.comparison-categories {
    margin-top: 15px;
}

.comparison-category {
    margin-bottom: 12px;
}

.comparison-category-name {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.comparison-category-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.comparison-category-fill {
    height: 100%;
    background: #3498db;
    border-radius: 4px;
    transition: width 0.3s;
}

.comparison-category-fill.high { background: #27ae60; }
.comparison-category-fill.medium { background: #f39c12; }
.comparison-category-fill.low { background: #e74c3c; }

.comparison-category-score {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    margin-top: 2px;
}

.comparison-red-flags {
    margin-top: 15px;
    padding: 10px;
    background: #fff5f5;
    border-radius: 5px;
    border-left: 3px solid #e74c3c;
}

.comparison-red-flags h4 {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.comparison-red-flags p {
    font-size: 0.8rem;
    color: #666;
}

.best-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #27ae60;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .comparison-container {
        flex-direction: column;
    }

    .comparison-card {
        max-width: 100%;
    }

    .saved-interviews-filters {
        flex-direction: column;
        align-items: stretch;
    }
}
