/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Navigation */
/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    opacity: 0.8;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

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

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* Features */
.features {
    padding: 4rem 0;
    background-color: white;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.feature h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

/* Cards */
.card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.card h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

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

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert ul {
    margin-left: 1.5rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-none,
.status-canceled,
.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-past_due {
    background-color: #fff3cd;
    color: #856404;
}

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

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tr:hover {
    background-color: #f8f9fa;
}

/* Subscribe Page */
.subscribe-container {
    max-width: 600px;
    margin: 2rem auto;
}

.pricing-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.price {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin: 1rem 0;
}

.price span {
    font-size: 1.5rem;
    color: #6c757d;
}

.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.pricing-card .features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.small-text {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    margin-top: 1rem;
}

#card-element {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
}

#card-errors {
    color: #721c24;
    margin-bottom: 1rem;
}

/* Installation */
.install-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.install-box {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
}

.install-box h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.install-box h2 {
    color: #667eea;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    text-align: center;
    margin-bottom: 1rem;
}

.install-box ol {
    margin-left: 1.5rem;
}

.install-box code {
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.25rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hamburger {
        display: flex;
    }
    
    .navbar .container {
        flex-direction: row;
        gap: 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 250px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        gap: 0;
        padding: 80px 0 20px;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem;
        font-size: 1rem;
        width: 100%;
    }
    
    .nav-menu a:hover,
    .nav-menu a.active {
        background: rgba(255, 255, 255, 0.1);
        opacity: 1;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hottubs-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    /* Overlay when menu is open */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        animation: fadeIn 0.3s;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .nav-menu a {
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: bottom 0.3s ease-in-out;
}

.pwa-install-banner.show {
    bottom: 0;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-banner-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
}

.pwa-banner-text strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.pwa-banner-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

#pwa-install-button {
    padding: 0.5rem 1.5rem;
    background: white;
    color: #3498db;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}

#pwa-install-button:hover {
    transform: scale(1.05);
}

.btn-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Standalone mode adjustments */
.standalone-mode {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    .pwa-banner-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .pwa-banner-icon {
        font-size: 2rem;
    }
    
    .pwa-banner-text strong {
        font-size: 1rem;
    }
    
    .pwa-banner-text p {
        font-size: 0.85rem;
    }
    
    #pwa-install-button {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

/* Target Water Quality Settings */
.target-settings {
    background: #f8f9fa;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.target-settings h4 {
    color: #28a745;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.target-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.target-control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.target-control-group label {
    font-weight: 600;
    min-width: 100px;
    color: #333;
}

.target-input {
    flex: 1;
    max-width: 150px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.target-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.target-unit {
    color: #666;
    font-weight: 500;
    min-width: 40px;
}

.target-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    color: #666;
    line-height: 1.6;
}

.target-info small {
    display: block;
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .target-control-group {
        flex-wrap: wrap;
    }
    
    .target-control-group label {
        min-width: 100%;
    }
    
    .target-input {
        max-width: 100%;
    }
}

/* Filter Schedule Styles */
.filter-schedule {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-cycle {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.filter-cycle > label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.time-inputs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.time-input-group label {
    font-weight: 500;
    color: #666;
    min-width: 50px;
}

.filter-schedule .control-btn {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .time-inputs {
        flex-direction: column;
    }
    
    .time-input-group {
        width: 100%;
    }
}

