/* Modern Dashboard Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.alarm-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.alarm-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    background: linear-gradient(135deg, #ff5252, #e53935);
}

.alarm-button i {
    font-size: 1rem;
}

.pc-status-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.pc-status-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    background: linear-gradient(135deg, #26a69a, #00695c);
}

.pc-status-button i {
    font-size: 1rem;
}

.database-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.database-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8, #6648a0);
}

.database-button i {
    font-size: 1rem;
}

.harmonics-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.3);
}

.harmonics-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
    background: linear-gradient(135deg, #ff8a80, #f8bbd9);
}

.harmonics-button i {
    font-size: 1rem;
}


.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #667eea;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status.connected {
    background: #d4edda;
    color: #155724;
}

.status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.status.error {
    background: #fff3cd;
    color: #856404;
}

.status i {
    font-size: 0.8rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.last-update {
    font-size: 0.8rem;
    color: #666;
}

/* Main Content */
.main-content {
    display: grid;
    gap: 30px;
}

/* Section Styles */
section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

section h2 i {
    color: #667eea;
}

/* Grid Layouts */
.voltage-grid, .current-grid, .power-grid, .energy-grid, .compensation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Frekans, Sıcaklık ve CosPhi Grid - Tek satırda 5 kart */
.frequency-temperature-cosphi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

/* Güç Değerleri Bölümü */
.power-values-section {
    grid-column: 1 / -1;
}

.power-row {
    margin-bottom: 25px;
}

.power-row:last-child {
    margin-bottom: 0;
}

.power-row h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.power-row h3 i {
    color: #667eea;
    font-size: 1rem;
}

/* Aktif, Reaktif ve Görünür Güç Grid'leri */
.active-power-grid, .reactive-power-grid, .apparent-power-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Card Styles */
.voltage-card, .current-card, .power-card, .energy-card, .compensation-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #dee2e6;
}

.voltage-card:hover, .current-card:hover, .cosphi-card:hover, .frequency-card:hover, .temperature-card:hover, .active-power-card:hover, .reactive-power-card:hover, .apparent-power-card:hover, .power-card:hover, .energy-card:hover, .compensation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Voltage Cards */
.voltage-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* Current Cards */
.current-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
}

/* CosPhi Cards */
.cosphi-card {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
}

/* Frequency Cards */
.frequency-card {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
}

/* Temperature Cards */
.temperature-card {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

/* Active Power Cards */
.active-power-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* Reactive Power Cards */
.reactive-power-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
}

/* Apparent Power Cards */
.apparent-power-card {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
}

.voltage-label, .current-label, .cosphi-label, .frequency-label, .temperature-label, .active-power-label, .reactive-power-label, .apparent-power-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 10px;
}

.current-label {
    color: #f57c00;
}

.cosphi-label {
    color: #c2185b;
}

.frequency-label {
    color: #2e7d32;
}

.temperature-label {
    color: #d32f2f;
}

.active-power-label {
    color: #1976d2;
}

.reactive-power-label {
    color: #f57c00;
}

.apparent-power-label {
    color: #7b1fa2;
}

.voltage-value, .current-value, .cosphi-value, .frequency-value, .temperature-value, .active-power-value, .reactive-power-value, .apparent-power-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0d47a1;
    margin-bottom: 10px;
}

.current-value {
    color: #e65100;
}

.cosphi-value {
    color: #880e4f;
}

.frequency-value {
    color: #1b5e20;
}

.temperature-value {
    color: #b71c1c;
}

.active-power-value {
    color: #0d47a1;
}

.reactive-power-value {
    color: #e65100;
}

.apparent-power-value {
    color: #4a148c;
}

.voltage-icon, .current-icon, .cosphi-icon, .frequency-icon, .temperature-icon, .active-power-icon, .reactive-power-icon, .apparent-power-icon {
    font-size: 1.5rem;
    color: #1976d2;
}

.current-icon {
    color: #f57c00;
}

.cosphi-icon {
    color: #c2185b;
}

.frequency-icon {
    color: #2e7d32;
}

.temperature-icon {
    color: #d32f2f;
}

.active-power-icon {
    color: #1976d2;
}

.reactive-power-icon {
    color: #f57c00;
}

.apparent-power-icon {
    color: #7b1fa2;
}

/* Power Cards */
.power-card {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
}

.power-label, .energy-label, .compensation-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #7b1fa2;
    margin-bottom: 10px;
}

.power-value, .energy-value, .compensation-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #4a148c;
    margin-bottom: 5px;
}

.power-unit, .energy-unit, .compensation-unit {
    font-size: 0.9rem;
    color: #7b1fa2;
    font-weight: 500;
}

.power-icon, .energy-icon, .compensation-icon {
    font-size: 1.5rem;
    color: #7b1fa2;
    margin-top: 10px;
}

/* Energy Cards */
.energy-card {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
}

.energy-label {
    color: #2e7d32;
}

.energy-value {
    color: #1b5e20;
}

.energy-unit {
    color: #2e7d32;
}

.energy-icon {
    color: #2e7d32;
}

/* Compensation Cards */
.compensation-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
}

.compensation-label {
    color: #ef6c00;
}

.compensation-value {
    color: #e65100;
}

.compensation-unit {
    color: #ef6c00;
}

.compensation-icon {
    color: #ef6c00;
}

/* Step Status Section */
.step-status-section {
    grid-column: 1 / -1;
}

.step-status-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.step-status-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
}

.step-item {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid #f44336;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.step-item.armed {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-color: #4caf50;
}

.step-item.disarmed {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #f44336;
}

.step-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #d32f2f;
    margin-bottom: 5px;
}

.step-item.armed .step-label {
    color: #2e7d32;
}

.step-status {
    font-size: 1.1rem;
    font-weight: 700;
    color: #b71c1c;
    text-transform: uppercase;
}

.step-item.armed .step-status {
    color: #1b5e20;
}

.step-number {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-top: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.step-item.armed .step-value {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.step-item.disarmed .step-value {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
}

/* Energy Section */
.energy-section {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.energy-header, .power-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.energy-header:hover, .power-header:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.energy-header h2, .power-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.energy-header h2 i, .power-header h2 i {
    color: #667eea;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #667eea;
    font-size: 1.2rem;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.energy-content, .power-content {
    padding: 25px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.energy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.energy-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #dee2e6;
}

.energy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.energy-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    line-height: 1.3;
}

.energy-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .status-indicator {
        align-items: center;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .voltage-grid, .power-grid, .energy-grid, .compensation-grid {
        grid-template-columns: 1fr;
    }
    
    .frequency-temperature-cosphi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .active-power-grid, .reactive-power-grid, .apparent-power-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .voltage-value, .power-value, .energy-value, .compensation-value {
        font-size: 1.8rem;
    }
    
    .step-status-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .frequency-temperature-cosphi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .active-power-grid, .reactive-power-grid, .apparent-power-grid {
        grid-template-columns: 1fr;
    }
    
    .step-status-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }
    
    .energy-grid {
        grid-template-columns: 1fr;
    }
    
    .voltage-value, .power-value, .energy-value, .compensation-value {
        font-size: 1.6rem;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.6;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Value Change Animation */
.value-updated {
    animation: valueUpdate 0.5s ease-in-out;
}

@keyframes valueUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
