/* PaCE Report Writer - Tool-Specific Styles */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid rgba(255, 107, 53, 0.3);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 107, 53, 0.05));
}

.modal-header h3 {
    margin: 0;
    color: #ff8855;
    font-size: 1.4em;
}

.modal-close {
    background: none;
    border: none;
    color: #ff6b35;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.modal-close:hover {
    background: rgba(255, 107, 53, 0.2);
    color: #ff8855;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Secondary Button Style */
.btn-secondary {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.2), rgba(100, 150, 255, 0.1));
    color: #8db4ff;
    border: 2px solid rgba(100, 150, 255, 0.3);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.3), rgba(100, 150, 255, 0.15));
    border-color: #6496ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 150, 255, 0.3);
}

/* Info Banner */
.info-banner {
    background: rgba(255, 107, 53, 0.1);
    border-left: 4px solid #ff6b35;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 6px;
    color: #e0e0e0;
    line-height: 1.6;
}

.info-banner strong {
    color: #ff8855;
}

/* Competency Reference Section */
.competency-reference-section {
    margin: 25px 0;
    border: 2px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.collapsible-header {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.1));
    border: none;
    padding: 15px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff8855;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.collapsible-header:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(255, 107, 53, 0.15));
}

.collapsible-header .toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s ease;
    color: #ff6b35;
}

.collapsible-header .subtitle {
    font-size: 0.85em;
    color: #ccc;
    font-weight: normal;
    margin-left: auto;
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.3);
}

.collapsible-content.active {
    padding: 20px;
}

/* Library Introduction */
.library-intro {
    background: rgba(255, 107, 53, 0.05);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #e0e0e0;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Competency Category Styling */
.competency-category {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 3px solid #ff6b35;
}

.competency-category h4 {
    color: #ff8855;
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.competency-category ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.competency-category ul li {
    padding: 8px 0;
    color: #e0e0e0;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.competency-category ul li:last-child {
    border-bottom: none;
}

.competency-category ul li strong {
    color: #ffa575;
    font-weight: 600;
}

/* Competency Selection Dropdowns */
.competency-select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.competency-select:hover {
    border-color: rgba(255, 107, 53, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.competency-select:focus {
    outline: none;
    border-color: #ff6b35;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.competency-select option {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 10px;
}

/* References Section */
.references-section {
    margin: 25px 0;
    border: 2px solid rgba(100, 150, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 50, 0.2);
}

.references-section .collapsible-header {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.2), rgba(100, 150, 255, 0.1));
    color: #8db4ff;
}

.references-section .collapsible-header:hover {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.3), rgba(100, 150, 255, 0.15));
}

.references-section .collapsible-header .toggle-icon {
    color: #6496ff;
}

.reference-links {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(100, 150, 255, 0.05);
    border-radius: 6px;
}

.reference-link {
    margin-bottom: 15px;
}

.reference-link:last-child {
    margin-bottom: 0;
}

.reference-link strong {
    display: block;
    color: #8db4ff;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.reference-link ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.reference-link ul li {
    padding: 5px 0;
}

.reference-link a {
    color: #6496ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.reference-link a:hover {
    color: #8db4ff;
    text-decoration: underline;
}

.references-section label {
    display: block;
    margin-bottom: 10px;
    color: #8db4ff;
    font-weight: 500;
}

.references-section textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95em;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
}

.references-section textarea:focus {
    outline: none;
    border-color: #6496ff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(100, 150, 255, 0.1);
}

.references-section textarea::placeholder {
    color: #888;
}

/* Form Row Layout for Side-by-Side Fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Helper Text Styling */
.helper-text {
    font-size: 0.85em;
    color: #aaa;
    margin-top: 8px;
    line-height: 1.4;
}

/* Tooltip Styling */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.95);
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
    line-height: 1.4;
    border: 1px solid #ff6b35;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #ff6b35 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.2em;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.8em;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .collapsible-header .subtitle {
        display: none;
    }
    
    .tooltip .tooltiptext {
        width: 200px;
        margin-left: -100px;
        font-size: 0.8em;
    }
    
    .competency-category {
        padding: 12px;
    }
    
    .competency-category h4 {
        font-size: 1em;
    }
}

/* Print Styles */
@media print {
    .competency-reference-section,
    .references-section,
    .btn-primary,
    .loading,
    .result-actions {
        display: none !important;
    }
}

/* Info Overlay */
.info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.info-popup {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid rgba(100, 150, 255, 0.3);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

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

.popup-header {
    padding: 20px 25px;
    border-bottom: 2px solid rgba(100, 150, 255, 0.3);
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.1), rgba(100, 150, 255, 0.05));
}

.popup-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8db4ff;
    font-size: 1.3em;
}

.info-icon-large {
    font-size: 1.5em;
}

.popup-content {
    padding: 25px;
    color: #e0e0e0;
    line-height: 1.6;
}

.popup-content p {
    margin: 0 0 15px 0;
}

.popup-content strong {
    color: #8db4ff;
}

.popup-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.popup-content ul li {
    margin: 8px 0;
    color: #ccc;
}

.popup-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.btn-acknowledge {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.3), rgba(100, 150, 255, 0.2));
    color: #8db4ff;
    border: 2px solid rgba(100, 150, 255, 0.5);
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
}

.btn-acknowledge:hover {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.4), rgba(100, 150, 255, 0.3));
    border-color: #6496ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 150, 255, 0.3);
}

/* Toggle switch for optional competencies */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}
.switch input { display: none; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #444;
    border-radius: 34px;
    transition: .3s;
    box-shadow: inset 0 0 4px rgba(0,0,0,.6);
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.switch input:checked + .slider { background: #ff6b35; }
.switch input:checked + .slider:before { transform: translateX(24px); }

/* Container reveal animation */
#competencySelectors { animation: fadeIn .25s ease-in; }
@keyframes fadeIn { from { opacity:0; transform: translateY(-4px);} to { opacity:1; transform: translateY(0);} }
