/* Reset and Base Styles */
:root {
    /* CUNY-inspired Color Palette */
    --primary-blue: #003DA5;
    --secondary-blue: #002D72;
    --dark-navy: #001F4C;
    --accent-red: #DC143C;
    --light-gray: #F8F9FA;
    --medium-gray: #E9ECEF;
    --border-gray: #DEE2E6;
    --text-dark: #212529;
    --text-muted: #6C757D;
    --text-light: #495057;
    --white: #FFFFFF;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

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

html, body {
    height: 100%;
    margin: 0;
    background: linear-gradient(180deg, var(--light-gray) 0%, var(--white) 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Header */
header {
    background: var(--white);
    border-bottom: 3px solid var(--primary-blue);
    box-shadow: var(--shadow-sm);
    padding: 30px 20px;
    text-align: center;
    width: 100%;
}

.header-content {
    max-width: 980px;
    margin: 0 auto;
}

header h1 {
    color: var(--primary-blue);
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    max-width: 980px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

/* Step Sections */
.step-section {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.step-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--secondary-blue);
    font-weight: 600;
}

.section-description {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--white);
    color: var(--text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-style: italic;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-label:hover {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(0, 61, 165, 0.02) 0%, rgba(0, 61, 165, 0.05) 100%);
}

.radio-label input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: var(--primary-blue);
}

.radio-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-text strong {
    font-size: 1.05em;
    font-weight: 600;
}

.radio-text small {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(0, 61, 165, 0.02) 0%, rgba(0, 61, 165, 0.05) 100%);
    border: 2px dashed var(--primary-blue);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.file-upload-label:hover {
    border-color: var(--secondary-blue);
    background: linear-gradient(135deg, rgba(0, 61, 165, 0.04) 0%, rgba(0, 61, 165, 0.08) 100%);
}

.file-upload-text {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Select Dropdown */
.select-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background-color: var(--white);
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.select-input option {
    padding: 10px;
}

/* Text Area */
.text-area {
    width: 100%;
    padding: 12px;
    font-size: 0.95em;
    font-family: 'Courier New', monospace;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    resize: vertical;
    min-height: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--white);
    color: var(--text-dark);
}

.text-area:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.1);
}

.text-area::placeholder {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Checkbox Group */
.checkbox-group {
    margin-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1em;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.checkbox-label span {
    font-weight: 500;
    color: var(--text-dark);
}

.learn-more-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.learn-more-link:hover {
    color: var(--secondary-blue);
    text-decoration: underline;
}

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    color: var(--white);
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-body h3 {
    color: var(--primary-blue);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-body h3:first-of-type {
    margin-top: 0;
}

.info-box {
    background: linear-gradient(135deg, rgba(0, 61, 165, 0.05) 0%, rgba(0, 61, 165, 0.08) 100%);
    border-left: 4px solid var(--primary-blue);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

.warning-box {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning);
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    color: #856404;
}

.modal-body ul, .modal-body ol {
    margin: 10px 0;
    padding-left: 25px;
}

.modal-body li {
    margin: 8px 0;
}

/* Buttons */
.btn-link {
    background: none;
    border: none;
    color: var(--primary-blue);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95em;
    padding: 0;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: var(--secondary-blue);
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.btn-primary:hover:not(:disabled) {
    background: var(--secondary-blue);
    border-color: var(--secondary-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    margin-left: 10px;
}

.btn-secondary:hover {
    background: var(--light-gray);
}

.action-section {
    text-align: center;
    margin: 40px 0;
}

/* Progress Section */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(0, 61, 165, 0.3);
    position: relative;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: var(--primary-blue);
    font-size: 0.95rem;
}

/* Log Container */
.log-container {
    max-height: 300px;
    overflow-y: auto;
    background: var(--light-gray);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-gray);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.error {
    color: var(--danger);
}

.log-entry.success {
    color: var(--success);
}

.log-entry.warning {
    color: #856404;
}

/* Results Section */
.results-summary {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-gray);
}

.results-summary h3 {
    margin-bottom: 10px;
    color: var(--primary-blue);
    font-weight: 600;
}

.results-summary ul {
    list-style: none;
    padding: 0;
}

.results-summary li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-gray);
}

.results-summary li:last-child {
    border-bottom: none;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.preview-container {
    margin-top: 20px;
}

.preview-container h3 {
    margin-bottom: 10px;
    color: var(--primary-blue);
    font-weight: 600;
}

.preview-container pre {
    background: var(--light-gray);
    border: 1px solid var(--border-gray);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.5;
}

/* Info Sections */
.info-section {
    border-left-color: #17a2b8;
}

.info-section h2 {
    color: #17a2b8;
}

.info-section h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #444;
}

.info-section ul,
.info-section ol {
    margin-left: 20px;
    margin-top: 10px;
}

.info-section li {
    margin-bottom: 8px;
}

/* Solution Boxes */
.solution-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.solution-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #667eea;
}

.code-example {
    background: var(--light-gray);
    border: 1px solid var(--border-gray);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    line-height: 1.5;
}

.code-example code {
    color: var(--accent-red);
}

.warning-text {
    color: var(--danger);
    font-weight: 600;
    margin-top: 10px;
}

/* Footer */
footer {
    margin-top: 60px;
    padding: 40px 20px;
    background: var(--light-gray);
    border-top: 1px solid var(--border-gray);
    text-align: center;
    width: 100%;
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
}

footer p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.8;
}

.footer-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    margin: 0 5px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--secondary-blue);
    text-decoration: underline;
}

/* Source Input Toggle */
.source-input {
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .main-content {
        padding: 0 15px;
        margin: 30px auto;
    }

    .step-section {
        padding: 20px;
    }

    .step-section h2 {
        font-size: 1.3rem;
    }

    .radio-group {
        gap: 10px;
    }

    .radio-label {
        padding: 12px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-left: 0;
        margin-bottom: 10px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 20px;
    }

    .results-actions {
        flex-direction: column;
    }
}

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

.step-section {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar Styling */
.log-container::-webkit-scrollbar,
.preview-container pre::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track,
.preview-container pre::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb,
.preview-container pre::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover,
.preview-container pre::-webkit-scrollbar-thumb:hover {
    background: #555;
}
