/* Free Simulation Page - Ma/Wa Design Principles */

/* Enhanced Team Logo Styles */
.team-logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.preview-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    background-color: var(--bg-secondary);
    padding: 4px;
}

.preview-logo:hover {
    transform: scale(1.05);
}

/* Logo placeholder for missing logos */
.logo-placeholder {
    width: 48px;
    height: 48px;
    background-color: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin: 4px;
}

/* Loading state for logos */
.preview-logo[src=""] {
    opacity: 0.6;
    animation: logoLoading 1.5s infinite ease-in-out;
}

@keyframes logoLoading {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Container & Layout (Ma - Generous Spacing) */
.free-simulation-container {
    padding: 3rem 0;
    min-height: 100vh;
    background-color: var(--bg-primary);
}

/* Hero Section */
.simulation-hero {
    text-align: center;
    padding: 6rem 2rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(16, 185, 129, 0.03) 100%);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

/* Hero Background Pattern */
.hero-background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    background-image: 
        linear-gradient(30deg, var(--cta-primary) 12%, transparent 12.5%, transparent 87%, var(--cta-primary) 87.5%, var(--cta-primary)),
        linear-gradient(150deg, var(--cta-primary) 12%, transparent 12.5%, transparent 87%, var(--cta-primary) 87.5%, var(--cta-primary)),
        linear-gradient(30deg, var(--cta-primary) 12%, transparent 12.5%, transparent 87%, var(--cta-primary) 87.5%, var(--cta-primary)),
        linear-gradient(150deg, var(--cta-primary) 12%, transparent 12.5%, transparent 87%, var(--cta-primary) 87.5%, var(--cta-primary));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
    animation: backgroundShift 20s linear infinite;
}

/* Hero Icon */
.hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2), 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards, float 6s ease-in-out infinite;
    position: relative;
    border: 3px solid var(--cta-primary);
}

.hero-icon::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 26px;
    animation: pulse 3s ease-in-out infinite;
}

.hero-icon i {
    font-size: 2rem;
    color: var(--cta-primary);
    position: relative;
    z-index: 1;
}

/* Hero Features */
.hero-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-feature i {
    color: var(--cta-primary);
    font-size: 1rem;
}

.hero-feature-divider {
    color: var(--border-color);
    font-size: 0.75rem;
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes backgroundShift {
    from {
        background-position: 0 0, 0 0, 40px 70px, 40px 70px;
    }
    to {
        background-position: 80px 140px, 80px 140px, 120px 210px, 120px 210px;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Content Grid (Wa - Harmonious Layout) */
.simulation-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .content-grid {
        grid-template-columns: 2fr 1fr;
        gap: 3rem;
    }
}

/* Panel Cards (Refined Aesthetic) */
.panel-card,
.preview-card,
.info-card,
.results-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.panel-header,
.preview-header,
.results-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.panel-title,
.preview-title,
.results-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.panel-body,
.preview-body,
.info-content,
.results-body {
    padding: 2.5rem;
}

/* Form Sections (Ma - Breathing Room) */
.simulation-form {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.form-section {
    position: relative;
}

/* Team Selection (Wa - Visual Harmony) */
.team-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: end;
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .vs-divider {
        text-align: center;
        padding: 0.5rem 0;
    }
}

.team-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label,
.section-label,
.setting-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-select,
.simulation-slider,
.setting-slider {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.team-select:hover,
.team-select:focus {
    border-color: var(--cta-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: lowercase;
}

/* Slider Styling (Subtle & Refined) */
.slider-container {
    margin-top: 1rem;
}

.simulation-slider,
.setting-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    outline: none;
    padding: 0;
    border: none;
    cursor: pointer;
    position: relative;
}

.simulation-slider::-webkit-slider-thumb,
.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--cta-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.simulation-slider:hover::-webkit-slider-thumb,
.setting-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    background: var(--cta-primary-hover);
}

/* Firefox support */
.simulation-slider::-moz-range-track,
.setting-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 4px;
}

.simulation-slider::-moz-range-thumb,
.setting-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--cta-primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.simulation-slider:hover::-moz-range-thumb,
.setting-slider:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    background: var(--cta-primary-hover);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.label-start,
.label-mid,
.label-end {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.value-display,
.setting-value {
    color: var(--cta-primary);
    font-weight: 600;
}

/* Advanced Settings (Ambient Interaction) */
.advanced-toggle {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.advanced-toggle:hover {
    background: var(--bg-primary);
    border-color: var(--cta-primary);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.advanced-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.advanced-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.advanced-content.show {
    max-height: 600px;
    margin-top: 1.5rem;
}

.settings-grid {
    display: grid;
    gap: 1.5rem;
}

.setting-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.setting-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Submit Button (CTA with Refined Style) */
.submit-section {
    margin-top: 1rem;
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    background: var(--cta-primary, #10B981);
    background-color: var(--cta-primary, #10B981);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.submit-button:hover {
    background: var(--cta-primary-hover, #0B956C);
    background-color: var(--cta-primary-hover, #0B956C);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

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

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

/* Preview Card (Ambient Design) */
.preview-card {
    position: sticky;
    top: 2rem;
}

.preview-empty {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Preview Matchup Styles */
.preview-matchup {
    padding: 1rem 0;
}

.matchup-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.team-display {
    text-align: center;
}

.team-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.team-icon {
    font-size: 2rem;
    color: var(--cta-primary);
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

/* Team Logo Styles */
.team-logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.team-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-logo {
    width: 60px;
    height: 60px;
}

/* Hover effect for team logos */
.team-display:hover .team-logo-container {
    transform: scale(1.05);
    border-color: var(--cta-primary);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.team-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.matchup-vs {
    display: flex;
    align-items: center;
    justify-content: center;
}

.matchup-vs .vs-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.preview-stats {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: grid;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Info Card (Minimalist Information) */
.info-card {
    margin-top: 1.5rem;
}

.info-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-icon {
    color: var(--primary-color);
    font-size: 0.75rem;
}

.info-cta {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cta-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cta-link {
    color: var(--cta-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.cta-link:hover {
    color: var(--cta-primary-hover);
    text-decoration: underline;
}

/* Results Section (Spacious Layout) */
.results-container {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 0 2rem;
}

/* Loading Modal (Refined Design) */
.loading-modal-content {
    border: none;
    border-radius: 16px;
    background: var(--bg-card);
}

.loading-container {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    position: relative;
}

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

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

.loading-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.loading-progress {
    height: 6px;
    background: rgba(206, 212, 218, 0.3);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0B956C 0%, var(--cta-primary) 50%, #0B956C 100%);
    background-size: 200% 100%;
    transition: width 0.5s ease-out;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

.progress-bar-animated {
    animation: gradient-shift 3s ease infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .panel-card,
[data-theme="dark"] .preview-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .results-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .setting-item {
    background: var(--bg-secondary);
}

[data-theme="dark"] .advanced-toggle {
    background: var(--bg-card);
}

[data-theme="dark"] .advanced-toggle:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .simulation-slider,
[data-theme="dark"] .setting-slider {
    background: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .simulation-slider::-webkit-slider-thumb,
[data-theme="dark"] .setting-slider::-webkit-slider-thumb {
    background: var(--cta-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border: 2px solid #1a1a1a;
}

[data-theme="dark"] .simulation-slider::-moz-range-track,
[data-theme="dark"] .setting-slider::-moz-range-track {
    background: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .simulation-slider::-moz-range-thumb,
[data-theme="dark"] .setting-slider::-moz-range-thumb {
    background: var(--cta-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border: 2px solid #1a1a1a;
}

/* Speed Metrics Styles */
.metric-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.metric-card h3 {
    font-size: 1.75rem;
    font-weight: 600;
}

.metric-card small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Details/Summary Styling */
details {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

details summary {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

details summary:hover {
    background: var(--bg-primary);
}

details summary::-webkit-details-marker {
    color: var(--cta-primary);
}

details[open] summary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Performance Table Styling */
.table-responsive {
    margin-top: 0.5rem;
}

.table-responsive table {
    font-size: 0.875rem;
}

.table-responsive th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Icon Colors in Breakdown */
.fa-database { opacity: 0.8; }
.fa-cloud-download-alt { opacity: 0.8; }
.fa-cogs { opacity: 0.8; }
.fa-calculator { opacity: 0.8; }
.fa-tachometer-alt { opacity: 0.8; }

/* Responsive Refinements */
@media (max-width: 768px) {
    .simulation-hero {
        padding: 4rem 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-icon {
        width: 60px;
        height: 60px;
    }
    
    .hero-icon i {
        font-size: 1.5rem;
    }
    
    .hero-features {
        gap: 1rem;
        font-size: 0.75rem;
    }
    
    .simulation-content {
        padding: 0 1rem;
    }
    
    .panel-body,
    .preview-body,
    .info-content {
        padding: 1.5rem;
    }
    
    .metric-card h3 {
        font-size: 1.5rem;
    }
}