/**
 * Heating Scheduler Styles
 * home.audiolo.gy
 */

:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --secondary-color: #3498db;
    --secondary-dark: #2980b9;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f6fa;
    --card-bg: #fff;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);

    /* Heating & Water colors */
    --heating-color: #e74c3c;
    --heating-dark: #c0392b;
    --heating-light: #fadbd8;
    --water-color: #1a5276;
    --water-dark: #154360;
    --water-light: #d4e6f1;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header */
.main-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

.user-info {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Status Badge (inline in boost headers) */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-on {
    background-color: #27ae60;
    color: white;
}

.status-badge.status-off {
    background-color: #95a5a6;
    color: white;
}

.status-badge .confirmed-icon {
    margin-left: 4px;
    font-size: 0.65rem;
}

/* Active Now Highlighting */
tr.active-now {
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.15) 0%, rgba(39, 174, 96, 0.05) 100%);
}

tr.active-now td:first-child {
    border-left: 3px solid #27ae60;
}

.active-indicator {
    color: #27ae60;
    margin-left: 8px;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

.btn-small {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-boost {
    background: var(--secondary-color);
    color: white;
    margin: 5px;
}

.btn-boost:hover {
    background: var(--secondary-dark);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

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

.section-header h2 {
    font-size: 1.3rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
}

/* Boost Section */
.boost-section {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    color: white;
}

.boost-section h2 {
    color: white;
}

.boost-section h2 i {
    color: #f1c40f;
}

.boost-section p {
    opacity: 0.9;
    margin-bottom: 15px;
}

.boost-buttons {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.boost-group {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
}

.boost-group h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.boost-group h3 i {
    font-size: 1.2rem;
}

/* Heating boost group */
.boost-heating {
    border: 3px solid var(--heating-color);
    background: rgba(231, 76, 60, 0.15);
}

/* Water boost group */
.boost-water {
    border: 3px solid #3498db;
    background: rgba(52, 152, 219, 0.15);
}

/* Heating buttons */
.btn-heating {
    background: var(--heating-color);
    color: white;
}

.btn-heating:hover {
    background: var(--heating-dark);
}

/* Water buttons */
.btn-water {
    background: #3498db;
    color: white;
}

.btn-water:hover {
    background: #2980b9;
}

.active-boosts {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.active-boosts h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.active-boosts ul {
    list-style: none;
}

.active-boosts li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 0;
}

.boost-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.boost-type.heating {
    background: var(--heating-color);
    color: white;
}

.boost-type.water {
    background: #3498db;
    color: white;
}

.boost-actioned {
    color: #27ae60;
    font-size: 1.1rem;
}

.boost-actioned i {
    filter: drop-shadow(0 0 2px rgba(39, 174, 96, 0.5));
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover {
    color: var(--text-color);
}

.tab.active {
    font-weight: 500;
}

.tab[data-tab="heating"].active {
    color: var(--heating-color);
    border-bottom-color: var(--heating-color);
}

.tab[data-tab="water"].active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

.tab-content.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr.disabled {
    opacity: 0.5;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

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

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input {
    width: auto;
    margin-right: 8px;
}

.checkbox-group {
    display: flex;
    gap: 20px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.checkbox-group input {
    width: auto;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h2 {
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text-color);
}

.modal form {
    padding: 20px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* Login Divider */
.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: var(--text-light);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.login-divider span {
    padding: 0 15px;
    font-size: 0.9rem;
}

/* Google Login Button */
.btn-google {
    background: #fff;
    color: #757575;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: #f5f5f5;
    border-color: #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-google svg {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        gap: 10px;
    }

    .boost-buttons {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 8px;
    }

    .btn-small {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}
