/* Base Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --darker: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--light);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    color: var(--accent);
    font-size: 1.75rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-selector select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light);
    padding: 0.5rem 1rem;
    font-family: inherit;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

/* Calculator Container */
.calculator-container {
    padding: 2rem 0;
}

.calculator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.calculator-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.calculator-header p {
    color: var(--gray-light);
    font-size: 1.1rem;
}

/* Grid Layout */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Sections */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.section-title i {
    color: var(--accent);
    font-size: 1.25rem;
}

/* Input Sections */
.input-section, .rate-section {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.appliance-input {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 500;
    color: var(--gray-light);
    font-size: 0.9rem;
}

.input-group input, .input-group select {
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Preset Section */
.preset-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.preset-section h3 {
    margin-bottom: 1rem;
    color: var(--gray-light);
    font-size: 1rem;
    font-weight: 500;
}

.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.preset-btn {
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: none;
    font-family: inherit;
}

.preset-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

/* Rate Section */
.rate-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tariff-info {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 15px;
    padding: 1.5rem;
}

.tariff-info h4 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.rate-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.rate-item .range {
    color: var(--gray-light);
}

.rate-item .rate {
    color: var(--secondary);
    font-weight: 600;
}

/* Cost Summary */
.cost-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.summary-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.summary-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--gray-light);
}

/* Appliances Section */
.appliances-section {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
}

.section-title .item-count {
    margin-left: auto;
    background: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.appliances-list {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--gray-light);
}

.empty-state p {
    color: var(--gray);
}

/* Appliance Item */
.appliance-item {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.appliance-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.appliance-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.appliance-details {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--gray-light);
}

.appliance-stats {
    text-align: right;
}

.power-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.cost-value {
    font-size: 1rem;
    color: var(--secondary);
}

.delete-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.list-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Breakdown Section */
.breakdown-section {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
}

.breakdown-content {
    min-height: 200px;
}

.empty-breakdown {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.empty-breakdown i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-breakdown p {
    color: var(--gray);
}

/* Bill Breakdown Styles */
.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-header h4 {
    color: var(--accent);
}

.total-units {
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--accent), #eab308);
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Charts Section */
.charts-section {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-container {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 15px;
    padding: 1.5rem;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--gray-light);
    font-size: 1.1rem;
}

.chart {
    height: 250px;
    position: relative;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 2rem;
}

.share-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--light);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
}

.share-option:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

.share-option i {
    font-size: 1.5rem;
}

.share-preview h4 {
    margin-bottom: 1rem;
    color: var(--gray-light);
}

.preview-content {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
    color: var(--light);
    backdrop-filter: blur(10px);
}

.notification-success { 
    border-color: #10b981; 
}

.notification-error { 
    border-color: #ef4444; 
}

.notification-info { 
    border-color: #2563eb; 
}

.notification-content { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
}

.notification-close { 
    background: none; 
    border: none; 
    color: var(--gray-light); 
    cursor: pointer; 
    padding: 0.25rem; 
    border-radius: 4px; 
}

.notification-close:hover { 
    background: rgba(255, 255, 255, 0.1); 
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .cost-summary {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .cost-summary {
        grid-template-columns: 1fr;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .preset-grid {
        grid-template-columns: 1fr;
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
    
    .appliance-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .appliance-stats {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    
    .list-actions {
        flex-direction: column;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .section-title .item-count {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .calculator-header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .input-section, .rate-section, .appliances-section, .charts-section, .breakdown-section {
        padding: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .summary-value {
        font-size: 1.25rem;
    }
    
    .charts-grid {
        gap: 1rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
}