/* ============================================
   College Finder - Styles
   Johan Juniors Soccer
   ============================================ */

:root {
    --primary: #1a5f2a;
    --primary-dark: #0d3d17;
    --primary-light: #2d8a42;
    --secondary: #f5a623;
    --secondary-dark: #d4890d;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-text p {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Main Content */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    padding-bottom: 4rem;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    width: 25%;
    transition: width 0.4s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active,
.step.completed {
    opacity: 1;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.section-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Form Elements */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox Cards */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.majors-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.regions-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.checkbox-card,
.radio-card {
    display: block;
    cursor: pointer;
}

.checkbox-card input,
.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-content,
.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-align: center;
    min-height: 60px;
}

.checkbox-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.checkbox-title,
.radio-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.checkbox-desc,
.radio-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.125rem;
}

.checkbox-card input:checked + .checkbox-content,
.radio-card input:checked + .radio-content {
    border-color: var(--primary);
    background: rgba(26, 95, 42, 0.05);
}

.checkbox-card:hover .checkbox-content,
.radio-card:hover .radio-content {
    border-color: var(--primary-light);
}

/* Radio Group */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

/* Buttons */
.button-row {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.btn {
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Results */
.results-card {
    max-width: 100%;
}

.results-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.summary-stat {
    background: var(--bg);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.summary-stat .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-stat .label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.result-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.school-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.school-location {
    font-size: 0.875rem;
    color: var(--text-light);
}

.match-score {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.match-score.excellent {
    background: var(--success);
}

.match-score.good {
    background: var(--primary);
}

.match-score.fair {
    background: var(--warning);
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-tag {
    background: var(--bg);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Major Selection System */
.major-search-container {
    margin-bottom: 1rem;
}

.major-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.major-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.selected-majors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    min-height: 1rem;
}

.selected-major-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary);
    color: white;
    padding: 0.375rem 0.625rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.selected-major-tag .remove-major {
    cursor: pointer;
    opacity: 0.8;
    font-size: 1rem;
    line-height: 1;
}

.selected-major-tag .remove-major:hover {
    opacity: 1;
}

.major-categories {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.major-category {
    border-bottom: 1px solid var(--border);
}

.major-category:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    background: var(--bg);
    transition: background 0.2s;
    user-select: none;
}

.category-header:hover {
    background: #e2e8f0;
}

.category-icon {
    font-size: 1.125rem;
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.category-toggle {
    font-size: 0.75rem;
    color: var(--text-light);
    transition: transform 0.2s;
}

.major-category.expanded .category-toggle {
    transform: rotate(180deg);
}

.category-majors {
    display: none;
    padding: 0.5rem 1rem 1rem;
    background: white;
}

.major-category.expanded .category-majors {
    display: block;
}

.major-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.major-option:hover {
    background: var(--bg);
}

.major-option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.major-option.hidden {
    display: none;
}

.field-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.special-programs {
    margin-bottom: 0.75rem;
}

.special-tag {
    display: inline-block;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid #fcd34d;
}

.result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

@media (max-width: 500px) {
    .result-details {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-icon {
    width: 20px;
    text-align: center;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.action-btn {
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

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

.action-btn.primary:hover {
    background: var(--primary-dark);
}

.action-btn.secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ID Camps Section */
.camps-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.camps-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.camp-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--secondary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.camp-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.camp-details {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Useful Links */
.links-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.links-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.link-card:hover {
    background: var(--primary);
    color: white;
}

.link-icon {
    font-size: 1.25rem;
}

.link-text {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.footer-content p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--secondary);
    text-decoration: none;
}

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

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    color: var(--text-light);
}

/* Print Styles */
@media print {
    header, footer, .button-row, .progress-container {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .result-card {
        break-inside: avoid;
    }
}

/* School Size Ranking Styles */
.checkbox-card.rankable {
    position: relative;
}

.checkbox-card.rankable .rank-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary, #15803d);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-card.rankable.ranked .rank-badge {
    opacity: 1;
}

.checkbox-card.rankable.ranked {
    border-color: var(--primary, #15803d);
    background: rgba(21, 128, 61, 0.05);
}

.checkbox-desc {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}
