/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main content */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Calculator section */
.calculator-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calculator-container {
    padding: 2rem;
}

.calculator-container h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Input groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tip buttons */
.tip-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tip-btn {
    padding: 0.8rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tip-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

.tip-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    accent-color: #667eea;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

.split-input {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e1e5e9;
}

/* Calculate button */
.calculate-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Results */
.results {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid #e1e5e9;
}

.results h3, .results h4 {
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.1rem;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item span:last-child {
    font-weight: 700;
    color: #667eea;
    font-size: 1.2rem;
}

.per-person-results {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #dee2e6;
}

/* Tip table section */
.tip-table-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tip-table-container {
    padding: 2rem;
}

.tip-table-container h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
}

.tip-table-container p {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Tip table */
.tip-table {
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #e1e5e9;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    padding: 1rem;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.table-row:hover {
    background: rgba(102, 126, 234, 0.05);
}

.table-row.highlighted {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
}

.table-row:last-child {
    border-bottom: none;
}

.table-header span,
.table-row span {
    text-align: center;
}

/* Content section */
.content-section {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.content-section h2 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.content-section h3 {
    color: #555;
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem 0;
}

.content-section h4 {
    color: #667eea;
    font-size: 1.2rem;
    margin: 1rem 0 0.5rem 0;
}

.content-section p {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.7;
}

.content-section ul {
    margin: 1rem 0 1rem 2rem;
    color: #666;
}

.content-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.tip-guide {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid #667eea;
    margin: 1.5rem 0;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .calculator-container,
    .tip-table-container,
    .content-section {
        padding: 1.5rem;
    }
    
    .tip-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .tip-btn {
        padding: 1rem;
    }
    
    .table-header,
    .table-row {
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .result-item {
        font-size: 1rem;
    }
    
    .result-item span:last-child {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .calculator-container,
    .tip-table-container,
    .content-section {
        padding: 1rem;
    }
    
    .tip-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .table-header,
    .table-row {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results,
.tip-table {
    animation: fadeIn 0.5s ease-out;
}

/* Loading state */
.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Focus styles for accessibility */
input:focus,
button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .calculator-section,
    .tip-table-section,
    .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

