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

body {
    font-family: 'Tahoma', 'Segoe UI', 'IRANSans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.subtitle {
    font-size: 12px;
    margin-top: 10px;
}

.form-section {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
}

select, button {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102,126,234,0.3);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    margin-top: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

button:active {
    transform: translateY(0);
}

.result-section {
    padding: 0 30px 30px 30px;
    display: none;
}

.result-section.show {
    display: block;
}

.output-card {
    background: #1e1e2f;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.output-title {
    color: #ffd700;
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.output-content {
    background: #0d0d1a;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #00ff9d;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.explanation-card {
    background: #e8f4fd;
    border-radius: 15px;
    padding: 20px;
    border-right: 5px solid #667eea;
}

.explanation-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.explanation-text {
    color: #34495e;
    line-height: 1.8;
    font-size: 14px;
}

.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.loading.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 10px;
    border-right: 5px solid #c00;
}

.footer {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
}