/* style.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.language-switcher {
    text-align: right;
    margin-bottom: 20px;
}

.language-switcher button {
    background: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
}

.language-switcher button.active {
    background: #3498db;
    color: white;
}

.formula {
    font-family: 'Roboto Mono', monospace;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
}

.control-panel {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.param-group {
    margin-bottom: 15px;
}

.param-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.param-group input, .param-group select {
    padding: 10px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
}

button {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #3498db;
}

.result-card.best {
    border-top-color: #27ae60;
    background: linear-gradient(135deg, #d5f4e6, #ffffff);
}

.result-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.success-rate {
    font-size: 2em;
    font-weight: bold;
    color: #27ae60;
    text-align: center;
    margin: 10px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background: #34495e;
    color: white;
    font-weight: bold;
}

tr:hover {
    background: #f8f9fa;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #7f8c8d;
}

.hidden {
    display: none;
}

.analysis-box {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 5px solid #f39c12;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.primorial-info {
    background: #e8f4f8;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
}

.article-section {
    margin: 40px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.article-section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.article-section h3 {
    color: #2c3e50;
    margin: 15px 0;
}

.article-section p {
    margin-bottom: 15px;
}

.article-section ul, .article-section ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.article-section li {
    margin-bottom: 8px;
}

.warning-box {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left: 5px solid #e74c3c;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.reference {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 5px;
}

.interactive-demo {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 2px dashed #3498db;
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
    color: #7f8c8d;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}