:root {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #3b82f6;
    --background: #f9fafb;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 0;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

#languageSelect {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

#languageSelect:hover {
    border-color: var(--primary-color);
}

.input-section {
    background-color: var(--surface);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-weight: 500;
    color: var(--text-primary);
}

#urlInput {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: border-color 0.2s;
}

#urlInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

.calculate-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    overflow: hidden;
}

.calculate-btn:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.calculate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.calculate-btn.loading .btn-text {
    visibility: hidden;
}

.calculate-btn.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.results-section {
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-out;
}

.results-section.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.result-card.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    margin-bottom: 20px;
}

.result-card h2, .result-card h3 {
    margin-bottom: 15px;
}

.result-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.large-number {
    font-size: 3rem;
    font-weight: 700;
}

.unit {
    font-size: 1.2rem;
    opacity: 0.9;
}

.result-description {
    opacity: 0.9;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.comparison-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.1rem;
}

.icon {
    font-size: 1.5rem;
}

.rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rating-icon {
    font-size: 2rem;
}

.rating-text {
    font-size: 1.2rem;
    font-weight: 500;
}

.rating-text.excellent { color: #10b981; }
.rating-text.good { color: #3b82f6; }
.rating-text.average { color: #f59e0b; }
.rating-text.poor { color: #ef4444; }

.tips-section {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list li::before {
    content: "💡";
    position: absolute;
    left: 0;
}

.info-section {
    margin-bottom: 40px;
}

.info-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-card {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.info-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
}

.info-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.info-card p {
    color: var(--text-secondary);
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.small-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .large-number {
        font-size: 2.5rem;
    }
}