/* Birthday Paradox Interactive Tool Styles */

.birthday-paradox-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Rockwell', serif;
}

.birthday-paradox-container h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.birthday-paradox-container h1 i {
    margin-right: 0.5rem;
    color: var(--secondary);
}

.explanation {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.simulation-area {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

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

.control-group label {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

.control-group span {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--secondary);
    text-align: center;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-group {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.results-area {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.probability-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, var(--primary) 0deg, #e9ecef 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.5s ease;
}

.probability-circle::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: white;
    z-index: 1;
}

.probability-text {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--primary);
}

.probability-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
}

.probability-label {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    line-height: 1.2;
}

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

.stat-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

.birthday-controls {
    text-align: center;
    margin-bottom: 1rem;
}

.trial-stats {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    border-left: 4px solid #f39c12;
}

.trial-stats h4 {
    color: #d68910;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.trial-stats h4 i {
    margin-right: 0.5rem;
    color: #f39c12;
}

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

.trial-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.pie-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pie-chart-container canvas {
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pie-chart-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pie-chart-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
}

.pie-chart-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.pie-chart-legend .legend-color.wins {
    background: #28a745;
}

.pie-chart-legend .legend-color.losses {
    background: #dc3545;
}

.trial-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.trial-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.trial-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.trial-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #f39c12;
}

.visualization-area {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.visualization-area h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.visualization-area h3 i {
    margin-right: 0.5rem;
    color: var(--secondary);
}

.birthday-status {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    text-align: center;
}

.status-message {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.75rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.status-message.shared {
    background: linear-gradient(135deg, #fff5f5, #ffe6e6);
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.status-message.unique {
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
    color: #3498db;
    border: 2px solid #3498db;
}

.birthday-display {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.birthday-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.placeholder-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 2rem 0;
}

.birthday-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.birthday-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.birthday-card.shared {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fff5f5, #ffe6e6);
    animation: highlightShared 0.5s ease;
}

.birthday-card.unique {
    border-color: #3498db;
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
}

.birthday-date {
    font-weight: bold;
    color: var(--primary);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    line-height: 1;
}

.birthday-month {
    color: #6c757d;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}

.birthday-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.birthday-count.unique {
    background: #3498db;
}

@keyframes highlightShared {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.birthday-chart {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

#birthdayCanvas {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.progress-area {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-weight: bold;
    color: var(--primary);
}

.theory {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 4px solid #f39c12;
}

.theory h3 {
    color: #d68910;
    margin-bottom: 1rem;
}

.theory h3 i {
    margin-right: 0.5rem;
    color: #f39c12;
}

.formula {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    text-align: center;
    margin: 1rem 0;
    border: 2px solid #f39c12;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fun-facts {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid #17a2b8;
}

.fun-facts h3 {
    color: #0c5460;
    margin-bottom: 1rem;
}

.fun-facts h3 i {
    margin-right: 0.5rem;
    color: #17a2b8;
}

.fun-facts ul {
    list-style: none;
    padding: 0;
}

.fun-facts li {
    background: white;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.fun-facts li:hover {
    transform: translateX(5px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .birthday-paradox-container {
        padding: 1rem;
    }
    
    .birthday-paradox-container h1 {
        font-size: 2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .results-area {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .probability-circle {
        width: 150px;
        height: 150px;
    }
    
    .probability-circle::before {
        width: 120px;
        height: 120px;
    }
    
    .probability-value {
        font-size: 2rem;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .trial-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .trial-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .trial-item {
        padding: 0.75rem;
    }
    
    .trial-value {
        font-size: 1.2rem;
    }
    
    .pie-chart-container canvas {
        width: 150px;
        height: 150px;
    }
}

/* Animation for probability circle */
@keyframes probabilityUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.probability-circle.updating {
    animation: probabilityUpdate 0.5s ease;
}

/* Animation for stat updates */
@keyframes statUpdate {
    0% { background-color: #f8f9fa; }
    50% { background-color: #e3f2fd; }
    100% { background-color: #f8f9fa; }
}

.stat-item.updating {
    animation: statUpdate 0.3s ease;
}
