:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --background-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-radius: 12px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --modal-overlay: rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color);
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Dashboard sections */
.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

section h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Battery card */
.battery-main {
    display: flex;
    justify-content: center;
}

.battery-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
}

.battery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.battery-card.primary {
    border-left: 4px solid var(--primary-color);
}

.battery-card.danger {
    border-left: 4px solid var(--danger-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.battery-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.battery-status.good {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--secondary-color);
}

.battery-status.warning {
    background-color: rgba(243, 156, 18, 0.15);
    color: var(--warning-color);
}

.battery-status.danger {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--danger-color);
}

.battery-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.battery-icon {
    width: 80%;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.battery-level {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: width 1s ease-in-out;
    border-radius: 5px;
}

.battery-card.danger .battery-level {
    background: linear-gradient(90deg, var(--danger-color), #ff7675);
}

.battery-percentage {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.battery-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(52, 152, 219, 0.05);
    padding: 15px;
    border-radius: var(--border-radius);
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.detail-value.current {
    color: var(--text-primary);
}

.detail-value.current.negative {
    color: var(--danger-color);
}

.detail-value.current.positive {
    color: var(--secondary-color);
}

/* Extended details */
.battery-extended {
    margin-top: -15px;
}

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

.detail-box {
    text-align: center;
    padding: 20px;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.detail-box:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateY(-3px);
}

.detail-box i {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.detail-box h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-box .value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.detail-box .sub-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Power consumption chart */
.chart-container {
    width: 100%;
    height: 250px;
    padding: 10px;
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 90%;
    padding-bottom: 10px;
}

.bar {
    width: 12%;
    background: linear-gradient(180deg, var(--primary-color), rgba(52, 152, 219, 0.5));
    border-radius: 5px 5px 0 0;
    transition: height 0.5s ease;
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding-top: 5px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.chart-labels span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.action-btn {
    background-color: var(--card-bg);
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.action-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.action-btn.secondary {
    background-color: #ecf0f1;
}

.action-btn.secondary:hover {
    background-color: var(--text-secondary);
    color: white;
}

.timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    font-size: 1.4rem;
    margin: 0;
}

.close-btn {
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.close-btn:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    font-size: 0.9rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .extended-grid {
        grid-template-columns: 1fr;
    }
    
    .battery-details {
        grid-template-columns: 1fr;
    }
    
    .detail-box {
        padding: 15px;
    }
    
    .quick-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.connection-info {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 10px;
    background-color: rgba(52, 152, 219, 0.05);
    padding: 12px;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.connection-info.important {
    background-color: rgba(243, 156, 18, 0.1);
    border-left: 3px solid var(--warning-color);
}

.connection-info strong {
    color: var(--text-primary);
}