/* Aquarium Pflege Portal - Stylesheet */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --gray: #6c757d;
    --border: #dee2e6;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --radius: 10px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

/* Header & Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-nav {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
}

.navbar-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav a:hover, .navbar-nav a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.user-menu {
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mobile Navigation */
@media (max-width: 992px) {
    .navbar {
        padding: 1rem;
    }
    
    .navbar-toggle {
        display: block;
        order: 3;
    }
    
    .navbar-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        order: 4;
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    
    .navbar-nav.show {
        display: flex;
    }
    
    .navbar-nav li {
        width: 100%;
    }
    
    .navbar-nav a {
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }
    
    .user-menu {
        order: 2;
    }
    
    .user-menu span {
        display: none;
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--light);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body { padding: 1.5rem; }

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--light);
}

/* Grid */
.row { display: flex; flex-wrap: wrap; margin: -0.75rem; }
.col { padding: 0.75rem; }
.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }

/* Mobile-first responsive columns */
@media (max-width: 992px) {
    .col-3 { width: 100%; }
}

@media (max-width: 768px) {
    .col-6, .col-4 { width: 100%; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--gray); color: white; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1.1rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--dark); }
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}
.form-control:focus { outline: none; border-color: var(--primary); }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}
textarea.form-control { min-height: 100px; resize: vertical; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }

/* Task List */
.task-list { list-style: none; }
.task-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    transition: background 0.2s ease;
}
.task-item:hover { background: var(--light); }
.task-item:last-child { border-bottom: none; }

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.task-checkbox:hover { background: rgba(102, 126, 234, 0.1); }
.task-checkbox.completed { background: var(--success); border-color: var(--success); color: white; }

.task-content { flex: 1; }
.task-title { font-weight: 500; margin-bottom: 0.25rem; }
.task-item.completed .task-title { text-decoration: line-through; color: var(--gray); }
.task-meta { font-size: 0.85rem; color: var(--gray); display: flex; gap: 1rem; flex-wrap: wrap; }
.task-meta span { display: flex; align-items: center; gap: 0.25rem; }
.task-actions { display: flex; gap: 0.5rem; }

/* Priority Badges */
.priority-badge { padding: 0.25rem 0.5rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.priority-high { background: #ffeaea; color: var(--danger); }
.priority-medium { background: #fff8e6; color: var(--warning); }
.priority-low { background: #e8f5e9; color: var(--success); }

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background: var(--light);
}

/* Aquarium Cards */
.aquarium-card { border-left: 4px solid var(--primary); }
.aquarium-card .aquarium-info { display: flex; align-items: center; gap: 1rem; }
.aquarium-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}
.aquarium-details h3 { margin-bottom: 0.25rem; }
.aquarium-details p { color: var(--gray); font-size: 0.9rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.stat-card { background: white; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); text-align: center; }
.stat-icon { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.5rem; color: white; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--dark); }
.stat-label { color: var(--gray); font-size: 0.9rem; }

/* Water Parameters */
.parameter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.parameter-card { background: var(--light); padding: 1rem; border-radius: 8px; text-align: center; }
.parameter-value { font-size: 1.5rem; font-weight: 700; }
.parameter-value.ok { color: var(--success); }
.parameter-value.warning { color: var(--warning); }
.parameter-value.danger { color: var(--danger); }
.parameter-label { font-size: 0.85rem; color: var(--gray); margin-top: 0.25rem; }
.parameter-range { font-size: 0.75rem; color: var(--gray); margin-top: 0.25rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--light); font-weight: 600; }
.table tbody tr:hover { background: var(--light); }

/* Modal */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 2000;
}
.modal-backdrop.show { display: flex; }
.modal {
    background: white; border-radius: var(--radius); width: 90%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab {
    padding: 0.75rem 1.5rem; cursor: pointer; border: none; background: none;
    font-size: 1rem; color: var(--gray); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.3s ease;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Progress Bar */
.progress { height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); transition: width 0.5s ease; }

/* Charts Container */
.chart-container { position: relative; height: 300px; width: 100%; }

/* Frequency Selector */
.frequency-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; }
.frequency-option {
    padding: 1rem; border: 2px solid var(--border); border-radius: 8px;
    text-align: center; cursor: pointer; transition: all 0.3s ease;
}
.frequency-option:hover { border-color: var(--primary); }
.frequency-option.selected { border-color: var(--primary); background: rgba(102, 126, 234, 0.1); }
.frequency-option i { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--primary); }

/* Day Selector */
.day-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.day-btn {
    width: 40px; height: 40px; border: 2px solid var(--border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 0.8rem; font-weight: 600; transition: all 0.3s ease; background: white;
}
.day-btn:hover { border-color: var(--primary); }
.day-btn.selected { background: var(--primary); border-color: var(--primary); color: white; }

/* Toast Notifications */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 3000; }
.toast {
    background: var(--dark); color: white; padding: 1rem 1.5rem; border-radius: 8px;
    margin-top: 0.5rem; box-shadow: 0 5px 20px rgba(0,0,0,0.2); display: flex;
    align-items: center; gap: 0.75rem; animation: slideIn 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Spinner */
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; z-index: 4000; }

/* Empty State */
.empty-state { text-align: center; padding: 3rem; color: var(--gray); }
.empty-state i { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { margin-bottom: 0.5rem; color: var(--dark); }

/* Overdue Badge */
.overdue-badge { background: var(--danger); color: white; padding: 0.2rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }

/* Responsive */
@media (max-width: 992px) {
    .col-6 { width: 100%; }
    .col-4 { width: 50%; }
    .col-3 { width: 100%; }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container { padding: 1rem; }
    
    .col-4 { width: 100%; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .modal { width: 95%; margin: 1rem; max-height: 95vh; }
    
    .task-item { flex-wrap: wrap; }
    
    .task-actions { 
        width: 100%; 
        justify-content: flex-end; 
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }
    
    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .card-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .parameter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .frequency-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .row {
        margin: -0.5rem;
    }
    
    .col {
        padding: 0.5rem;
    }
    
    h1 { font-size: 1.5rem; }
    
    .aquarium-info {
        flex-direction: column;
        text-align: center;
    }
    
    .d-flex.justify-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .d-flex.justify-between .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    
    .stat-card { padding: 1rem; }
    
    .stat-value { font-size: 1.5rem; }
    
    .parameter-grid { grid-template-columns: 1fr; }
    
    .day-selector {
        justify-content: center;
    }
    
    .day-btn {
        width: 36px;
        height: 36px;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .form-control {
        padding: 0.6rem 0.8rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand i {
        font-size: 1.2rem;
    }
    
    .alert {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }
.hidden { display: none; }
