/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 20px;
    color: white;
    border-radius: 16px 16px 0 0;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 4px;
}

.card-content {
    padding: 24px;
}

/* Header Styles */
.header-card {
    background: linear-gradient(135deg, #2563eb 0%, #059669 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.3);
    overflow: hidden;
}

.header-content {
    padding: 24px;
    text-align: center;
    color: white;
}

.header-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sun-icon {
    color: #fbbf24;
    animation: pulse 2s infinite;
}

.sparkle-icon {
    color: #fbbf24;
    font-size: 1.5rem;
}

.header-subtitle {
    font-size: 1rem;
    color: #bfdbfe;
    margin-bottom: 12px;
}

.header-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    display: inline-block;
    font-weight: 500;
}

/* Section Headers */
.appliance-header {
    background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
}

.appliances-list-header {
    background: linear-gradient(135deg, #c026d3 0%, #ec4899 100%);
}

.system-config-header {
    background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
}

.results-header {
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
}

.results-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.results-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Input Styles */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

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

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

.input-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.input-field, .select-field {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-field:focus, .select-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.btn-calculate {
    background: linear-gradient(135deg, #f97316 0%, #dc2626 100%);
    color: white;
    font-size: 1.1rem;
    padding: 16px 32px;
    width: 100%;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    padding: 8px 16px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-remove {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Appliance List Styles */
.appliance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    gap: 12px;
}

.appliance-item:hover {
    border-color: #3b82f6;
    transform: translateX(4px);
}

.appliance-info {
    flex: 1;
    min-width: 200px;
}

.appliance-name {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.appliance-details {
    color: #6b7280;
    font-size: 0.9rem;
}

.appliance-energy {
    font-weight: 600;
    color: #2563eb;
}

/* Results Styles */
.results-section {
    margin-bottom: 32px;
}

.results-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Energy Cards */
.energy-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.energy-card {
    padding: 20px;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.energy-card:hover {
    transform: scale(1.05);
}

.energy-card.daily {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.energy-card.monthly {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.energy-card.annual {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.energy-card-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.energy-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.energy-card-sub {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Component Cards */
.component-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.component-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid;
    transition: all 0.3s ease;
}

.component-card:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.component-card.solar-panels {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
}

.component-card.charge-controller {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border-color: #c4b5fd;
}

.component-card.battery-bank {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #6ee7b7;
}

.component-icon {
    font-size: 1.8rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.solar-panels .component-icon {
    color: #2563eb;
}

.charge-controller .component-icon {
    color: #7c3aed;
}

.battery-bank .component-icon {
    color: #059669;
}

.component-content {
    flex: 1;
}

.component-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.component-value {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.component-sub {
    font-size: 0.85rem;
    color: #6b7280;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* Assumptions Grid */
.assumptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.assumption-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.assumption-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.assumption-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 4px;
        gap: 12px;
    }
    
    .header-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .card-header {
        padding: 16px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .input-grid, .config-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .energy-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .component-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .component-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .results-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .results-actions {
        justify-content: center;
    }
    
    .appliance-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .assumptions-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.3rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .energy-card-value {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-calculate {
        font-size: 1rem;
        padding: 14px 28px;
    }
}

