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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 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: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    text-align: center;
    padding: 30px;
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    padding: 15px 30px;
    color: #666;
    font-size: 1.1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 40px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

input[type="number"] {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

#calculateBtn {
    background: linear-gradient(135deg, #28a745, #20c997);
    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;
    margin-top: 10px;
}

#calculateBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.results-section {
    display: none;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
}

.results-section h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5rem;
    text-align: center;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.result-label {
    font-weight: 600;
    color: #555;
}

.result-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #28a745;
}

.cost-highlight {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 15px 0;
}

.cost-highlight .result-label,
.cost-highlight .result-value {
    color: white;
}

.breakdown {
    margin-top: 30px;
}

.breakdown h4 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.breakdown-table th,
.breakdown-table td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid #dee2e6;
}

.breakdown-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.breakdown-table th:first-child,
.breakdown-table td:first-child {
    text-align: center;
}

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

@media (max-width: 768px) {
    .calculator {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
        padding: 20px;
    }
    
    .breakdown-table {
        font-size: 0.8rem;
    }
    
    .breakdown-table th,
    .breakdown-table td {
        padding: 6px 8px;
    }
}

/* Tooltip styles */
.tooltip-container {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #6b7280;
    color: white;
    font-size: 10px;
    font-weight: 600;
    cursor: help;
    transition: background-color 0.2s;
    position: relative;
}

.info-icon:hover {
    background-color: #374151;
}

.tooltip-text {
    visibility: hidden;
    position: fixed;
    z-index: 1000;
    background-color: #1f2937;
    color: white;
    text-align: left;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: normal;
    line-height: 1.4;
    width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 20px;
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .calculator {
        padding: 15px;
    }
}