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

:root {
    --accent-color: #667eea;
    --accent-hover: #5a67d8;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

main {
    flex: 1;
}

.calculator-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

select, input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f9fafb;
}

select:focus, input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

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

.result-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f3f4f6;
}

.result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.result-card h3 {
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.result-card h3 i {
    color: #667eea;
}

.result-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

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

.result-item .value {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.charging-info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.charging-info p {
    color: #1e40af;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.charging-info i {
    margin-top: 2px;
    flex-shrink: 0;
}

.info-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.info-section h3 {
    color: #1e293b;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
}

.info-section h3 i {
    color: #f59e0b;
}

.tips-grid {
    display: grid;
    gap: 20px;
}

.tip {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.tip:hover {
    transform: translateY(-2px);
}

.tip i {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.tip h4 {
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.tip p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

footer i {
    color: #ff6b6b;
    margin: 0 5px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .calculator-card {
        padding: 20px;
        border-radius: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .info-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .calculator-card {
        padding: 15px;
    }
    
    select, input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .calculate-btn {
        padding: 15px;
        font-size: 1rem;
    }
}

/* Animation for result appearance */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: slideIn 0.5s ease-out;
}

/* Loading state */
.calculate-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.calculate-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Quick buttons for percentage selection */
.quick-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.quick-btn {
    background: var(--accent-color, #667eea);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quick-btn:hover {
    background: var(--accent-hover, #5a67d8);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.quick-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive adjustments for quick buttons */
@media (max-width: 768px) {
    .quick-buttons {
        gap: 6px;
        margin-top: 10px;
    }
    
    .quick-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-width: 45px;
    }
}

@media (max-width: 480px) {
    .quick-buttons {
        gap: 4px;
        margin-top: 8px;
    }
    
    .quick-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        min-width: 40px;
    }
}

/* Cost input group styling */
.cost-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cost-input-group input {
    flex: 1;
}

.cost-input-group select {
    width: 80px;
    min-width: 80px;
}

/* Cost results styling */
.result-item.cost-highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
}

.result-item.cost-highlight .label {
    color: #92400e;
    font-weight: 600;
}

.result-item.cost-highlight .value {
    color: #92400e;
    font-weight: 700;
}

/* Responsive adjustments for cost inputs */
@media (max-width: 768px) {
    .cost-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .cost-input-group select {
        width: 100%;
        min-width: auto;
    }
}

/* Optional label styling */
.optional {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 400;
}