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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #2a2a2a;
    min-height: 100vh;
    padding: 20px;
    color: #e0e0e0;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #3a3a3a;
}

header h1 {
    font-size: 2em;
    font-weight: 300;
    color: #e0e0e0;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.nav-link {
    color: #999;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 6px;
    background: transparent;
    transition: all 0.2s ease;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #c85a5a;
}

.nav-link.active {
    color: #c85a5a;
    border-bottom-color: #c85a5a;
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.temperature-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.current-reading {
    background: #333;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #3a3a3a;
    text-align: center;
}

.current-reading h2 {
    margin-bottom: 30px;
    color: #999;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.temperature-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin: 30px 0;
}

.temp-value {
    font-size: 3.5em;
    font-weight: 200;
    color: #c85a5a;
    line-height: 1;
}

.temp-unit {
    font-size: 2em;
    color: #666;
    margin-left: 8px;
    font-weight: 300;
}

.meta-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #3a3a3a;
}

.meta-info p {
    margin: 10px 0;
    color: #999;
    font-size: 0.85em;
}

.meta-info span {
    color: #e0e0e0;
    font-weight: 400;
}

.chart-controls {
    grid-column: 1 / -1;
    background: #333;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #3a3a3a;
    text-align: center;
}

.chart-controls h2 {
    margin-bottom: 20px;
    color: #999;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-range-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.time-btn {
    padding: 10px 20px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: #999;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.time-btn:hover {
    background: #3a3a3a;
    border-color: #c85a5a;
    color: #c85a5a;
}

.time-btn.active {
    background: #c85a5a;
    color: #fff;
    border-color: #c85a5a;
}

.chart-container {
    grid-column: 1 / -1;
    background: #333;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #3a3a3a;
    height: 450px;
    position: relative;
}

.recent-readings {
    grid-column: 1 / -1;
    background: #333;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #3a3a3a;
    max-height: 250px;
    overflow-y: auto;
}

.recent-readings h2 {
    margin-bottom: 20px;
    color: #999;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

#readings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reading-item {
    padding: 12px 15px;
    background: #2a2a2a;
    border-radius: 6px;
    border-left: 3px solid #c85a5a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.reading-item:hover {
    background: #3a3a3a;
}

.reading-item .temp {
    font-size: 1.2em;
    font-weight: 400;
    color: #c85a5a;
}

.reading-item .time {
    color: #999;
    font-size: 0.85em;
}

/* Settings Page Styles */
.settings-page {
    max-width: 600px;
    margin: 0 auto;
}

.settings-card {
    background: #333;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #3a3a3a;
}

.settings-card h2 {
    color: #e0e0e0;
    margin-bottom: 30px;
    font-size: 1.3em;
    font-weight: 400;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-weight: 400;
    font-size: 0.9em;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.2s ease;
    background: #2a2a2a;
    color: #e0e0e0;
}

.form-group input:focus {
    outline: none;
    border-color: #c85a5a;
    box-shadow: 0 0 0 2px rgba(200, 90, 90, 0.2);
}

.form-group input::placeholder {
    color: #666;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.8em;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.toggle-btn {
    position: relative;
    width: 80px;
    height: 40px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.toggle-btn:hover {
    border-color: #c85a5a;
}

.toggle-btn.active {
    background: #c85a5a;
    border-color: #c85a5a;
}

.toggle-slider {
    position: absolute;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    left: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active .toggle-slider {
    left: calc(100% - 36px);
    background: #fff;
}

.toggle-label {
    font-size: 0.85em;
    font-weight: 500;
    color: #999;
    transition: color 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.toggle-btn.active .toggle-label {
    color: #fff;
}

.toggle-btn:not(.active) .toggle-label {
    margin-left: auto;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #c85a5a;
    color: #fff;
}

.btn-primary:hover {
    background: #b84a4a;
}

.btn-secondary {
    background: #555;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #666;
}

.btn-danger {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.danger-zone {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #dc3545;
    text-align: center;
}

.danger-zone h3 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.danger-zone p {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    display: none;
    text-align: center;
}

.status-message.success {
    background: rgba(200, 90, 90, 0.2);
    color: #c85a5a;
    border: 1px solid #c85a5a;
    display: block;
}

.status-message.error {
    background: rgba(200, 90, 90, 0.1);
    color: #c85a5a;
    border: 1px solid #c85a5a;
    display: block;
}

.api-info {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #3a3a3a;
    text-align: center;
}

.api-info h3 {
    color: #e0e0e0;
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: 400;
}

.api-info p {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.api-info code {
    display: block;
    background: #2a2a2a;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    color: #c85a5a;
    font-weight: 400;
    border: 1px solid #3a3a3a;
}

.info-note {
    margin-top: 15px;
    padding: 12px;
    background: #2a2a2a;
    border-left: 3px solid #c85a5a;
    border-radius: 4px;
    color: #999;
    font-size: 0.85em;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 768px) {
    .temperature-widgets {
        grid-template-columns: 1fr;
    }
    
    .chart-controls,
    .chart-container,
    .recent-readings {
        grid-column: 1;
    }
    
    .temp-value {
        font-size: 3em;
    }

    .main-nav {
        flex-direction: column;
        gap: 10px;
    }

    .settings-card {
        padding: 25px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}
