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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    padding: 10px;
    text-align: center;
    color: #2d3436;
}

header h1 {
    font-size: 1rem;
    margin: 2px 0;
    font-weight: 700;
}

header h2 {
    font-size: 1.5rem;
    margin: 2px 0;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Tabs */
.calculator-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-button.active {
    background: #007bff;
    color: white;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.card h4 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Input Groups */
.input-group {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.input-group label {
    font-weight: 500;
    color: #495057;
    min-width: 150px;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #007bff;
}

.input-group select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    flex-shrink: 0;
}

/* Keep input and select together */
.input-with-unit {
    display: flex;
    gap: 8px;
    flex: 1;
}

.input-with-unit input {
    flex: 1;
    margin: 0;
}

.input-with-unit select {
    margin: 0;
    min-width: 80px;
}

.unit {
    color: #6c757d;
    font-weight: 500;
    min-width: 60px;
}

/* Buttons */
.calculate-btn {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results */
.results {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-radius: 10px;
    border-left: 4px solid #00b894;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item .label {
    font-weight: 500;
    color: #495057;
}

.result-item .value {
    font-weight: 600;
    color: #00b894;
    font-size: 1.1rem;
}

/* Beer Styles Grid */
.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.style-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.style-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.style-name {
    font-weight: 600;
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.style-range {
    color: #6c757d;
    margin-bottom: 5px;
}

.style-typical {
    color: #007bff;
    font-weight: 600;
}

/* Footer */
footer {
    background: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header h2 {
        font-size: 1.3rem;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .input-group label {
        min-width: auto;
        margin-bottom: 5px;
    }
    
    /* Keep input and unit together even on mobile */
    .input-with-unit {
        display: flex !important;
        gap: 8px;
        width: 100%;
    }
    
    .input-with-unit input {
        flex: 1;
        min-width: 0;
    }
    
    .input-with-unit select {
        min-width: 70px;
        flex-shrink: 0;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .styles-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
