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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #e0f2e9 0%, #fce4ec 50%, #e0f2e9 100%);
    color: #2d3748;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(167, 199, 181, 0.3);
    padding: 10px 0;
    margin-bottom: 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 2px 10px rgba(140, 184, 170, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.header-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 15px 0;
}

.header-title {
    flex: 1;
    text-align: right;
    padding-right: 20px;
    border-right: 1px solid #a7c7b5;
}

.educational-btn-container {
    flex: 1;
    text-align: left;
    padding-left: 20px;
}

.educational-btn {
    font-size: 14px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #a7c7b5;
    border-radius: 20px;
    color: #ec4899;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.educational-btn:hover {
    background: rgba(140, 184, 170, 0.1);
    border-color: #8cb8aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(140, 184, 170, 0.15);
}

.educational-btn {
    align-self: flex-start;
    font-size: 14px;
    padding: 8px 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-icon {
    width: 32px;
    height: 32px;
    color: #ec4899;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #8cb8aa 0%, #6a9c89 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(140, 184, 170, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(140, 184, 170, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #374151;
    border: 2px solid rgba(140, 184, 170, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(140, 184, 170, 0.1);
    transform: translateY(-2px);
}

.btn-tertiary {
    background: rgba(255, 255, 255, 0.8);
    color: #8cb8aa;
    border: 2px solid rgba(140, 184, 170, 0.2);
}

.btn-tertiary:hover {
    background: rgba(140, 184, 170, 0.1);
    transform: translateY(-2px);
}

/* Collapsible Education Section */
.education-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(255, 182, 193, 0.2);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    overflow: hidden;
}

.education-header {
    padding: 15px 20px;
    cursor: pointer;
    background: rgba(236, 72, 153, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.education-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

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

.education-content {
    padding: 0 20px 20px;
}

.intro-text {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(255, 182, 193, 0.2);
    backdrop-filter: blur(10px);
    text-align: center;
}

.intro-text p {
    font-size: 15px;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

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

.education-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(255, 182, 193, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.education-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.indicator.green { background: #10b981; }

.chart-icon {
    width: 32px;
    height: 32px;
    color: #8cb8aa;
}
.indicator.red { background: #ef4444; }
.indicator.blue { background: #3b82f6; }

.education-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.education-card ul {
    list-style: none;
}

.education-card li {
    padding: 4px 0;
    color: #6b7280;
    font-size: 13px;
}

.education-card li::before {
    content: "✓";
    color: #ec4899;
    font-weight: bold;
    margin-right: 8px;
}

/* Main Content */
.main-content {
    display: grid;
    gap: 20px;
}

/* Top Controls Section */
.top-controls {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(140, 184, 170, 0.2);
    backdrop-filter: blur(10px);
}

.top-controls h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    text-align: center;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.control-group input {
    padding: 10px 12px;
    border: 2px solid rgba(140, 184, 170, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    color: #1f2937;
    transition: all 0.3s ease;
}

.control-group input:focus {
    outline: none;
    border-color: #8cb8aa;
    box-shadow: 0 0 0 3px rgba(140, 184, 170, 0.1);
}

.control-group small {
    font-size: 11px;
    color: #6b7280;
}

/* Simulation Control Section */
.simulation-control {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(140, 184, 170, 0.2);
    backdrop-filter: blur(10px);
}

.simulation-control-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.progress-container {
    width: 100%;
    max-width: 600px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(140, 184, 170, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8cb8aa, #6a9c89);
    border-radius: 6px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.button-group-main {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(140, 184, 170, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(140, 184, 170, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(140, 184, 170, 0.15);
}

.btn-tertiary:hover {
    background: rgba(140, 184, 170, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(140, 184, 170, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #374151;
    border: 2px solid rgba(140, 184, 170, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(140, 184, 170, 0.1);
    transform: translateY(-2px);
}

.btn-tertiary {
    background: rgba(255, 255, 255, 0.8);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.2);
}

.btn-tertiary:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
}

/* Desktop Layout Container */
.desktop-layout-container {
    display: grid;
    gap: 20px;
}

/* Chart Section */
.chart-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(140, 184, 170, 0.2);
    backdrop-filter: blur(10px);
}

.chart-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
}

.no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 2px solid rgba(140, 184, 170, 0.3);
}

.no-data p {
    color: #6b7280;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* Stats Section */
.stats-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(140, 184, 170, 0.2);
    backdrop-filter: blur(10px);
}

.stats-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    text-align: center;
}

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

.stats-group {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(236, 72, 153, 0.1);
}

.stats-group.summary {
    background: linear-gradient(135deg, rgba(140, 184, 170, 0.1) 0%, rgba(106, 156, 137, 0.1) 100%);
}

.stats-group h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
    text-align: center;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(140, 184, 170, 0.1);
}

.stats-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.stat-value.green {
    color: #10b981;
}

.stat-value.red {
    color: #ef4444;
}

.stat-value.big {
    font-size: 16px;
}

/* Responsive Design */
@media (min-width: 768px) {
    .header h1 {
        font-size: 26px;
    }
    
    .education-header h2 {
        font-size: 20px;
    }
    
    .intro-text p {
        font-size: 16px;
    }
    
    .desktop-layout-container {
        grid-template-columns: 2fr 1fr;
    }
    
    .chart-section {
        min-width: 0; /* Prevents flex items from overflowing */
    }
    
    .stats-section {
        min-width: 0; /* Prevents flex items from overflowing */
    }
    
    /* Ensure chart takes full height available */
    .chart-wrapper {
        height: 400px;
    }
    
    /* Optimize stats layout for sidebar */
    .stats-section h2 {
        text-align: left;
        margin-bottom: 16px;
        font-size: 18px;
    }
    
    .stats-grid {
        gap: 16px;
    }
    
    .stats-group {
        padding: 16px;
    }
    
    .stats-group h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .stats-row {
        padding: 6px 0;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .stat-value.big {
        font-size: 15px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    
    .header-content,
    .container {
        max-width: 1600px;
    }
    
    .chart-wrapper {
        height: 450px;
    }
    
    .stats-group h3 {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 14px;
    }

    .stat-value.big {
        font-size: 16px;
    }

    .btn {
        padding: 14px 28px;
        font-size: 16px;
        min-width: 130px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(140, 184, 170, 0.3);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.close {
    color: #8cb8aa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #6a9c89;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(140, 184, 170, 0.2);
    border: 1px solid #e2e8f0;
}

.modal-body h1 {
    font-size: 28px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ec4899 0%, #6a9c89 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.modal-body h2 {
    font-size: 22px;
    margin: 25px 0 15px 0;
    color: #ec4899;
}

/* Distribution Chart Section */
.distribution-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(140, 184, 170, 0.2);
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

.distribution-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    text-align: center;
}

.distribution-wrapper {
    position: relative;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.distribution-explanation {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 0 20px;
}

.distribution-explanation p {
    margin: 0;
}

.modal-body h2 {
    font-size: 22px;
    margin: 25px 0 15px 0;
    color: #1f2937;
}

.modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body li {
    margin: 10px 0;
    font-size: 16px;
    color: #374151;
    position: relative;
    padding-left: 20px;
}

.modal-body li::before {
    content: "•";
    color: #8cb8aa;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

.modal-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(140, 184, 170, 0.1);
}

.modal-body p {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 15px;
}

.modal-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.modal-body li {
    margin: 10px 0;
    font-size: 16px;
    color: #374151;
}

.modal-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10% auto;
    }

    .modal-body h1 {
        font-size: 24px;
    }

    .modal-body h2 {
        font-size: 20px;
    }

    .modal-body p,
    .modal-body li {
        font-size: 14px;
    }
}