/* ClearCare Water Testing - Custom Styles */
/* Built on Bootstrap 5.3.2 with custom ClearCare branding */

:root {
    /* ClearCare Primary Colors - From PRD/Screenshots */
    --clearcare-primary: #00E5FF;          /* Bright cyan from panel headers */
    --clearcare-secondary: #1DE9B6;        /* Turquoise accent color */
    --clearcare-dark: #1976D2;             /* Dark blue for navigation */
    --clearcare-light: #4FFFDF;            /* Light cyan variant */
    
    /* Typography */
    --font-family-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Button Colors - Blue Gradients from Screenshots */
    --btn-primary-bg: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    --btn-primary-hover: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    --btn-shadow: 0 3px 6px rgba(33, 150, 243, 0.3);
    --btn-shadow-hover: 0 6px 12px rgba(33, 150, 243, 0.4);
    
    /* Status Colors */
    --status-success: #4CAF50;
    --status-warning: #FF9800;
    --status-error: #F44336;
    --status-info: #2196F3;
}

/* ===== GLOBAL TYPOGRAPHY ===== */
body {
    font-family: var(--font-family-primary);
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
    background: linear-gradient(180deg, var(--clearcare-dark) 0%, #1565C0 100%);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    padding: 0.75rem 1rem;
    border-radius: 0;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: rgba(255, 255, 255, 0.3);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--clearcare-primary);
    font-weight: 600;
}

/* Ensure sidebar content is properly contained */
.sidebar .flex-grow-1 {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== MAIN LAYOUT ===== */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
}

/* ===== TOP HEADER ===== */
.top-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ===== CUSTOMER TABS ===== */
.customer-tabs {
    background: white;
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.customer-tabs .nav-link {
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    border-radius: 0;
}

.customer-tabs .nav-link:hover {
    color: var(--clearcare-dark);
    background: #f8f9fa;
}

.customer-tabs .nav-link.active {
    color: var(--clearcare-primary);
    border-bottom-color: var(--clearcare-primary);
    font-weight: 600;
    background: transparent;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--btn-primary-bg);
    border: none;
    box-shadow: var(--btn-shadow);
    color: white;
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-hover);
    border: none;
    color: white;
}

.btn-primary:focus,
.btn-primary:active {
    background: var(--btn-primary-hover);
    border: none;
    box-shadow: var(--btn-shadow);
    color: white;
}

/* ===== TABLE STYLING ===== */
.table-primary {
    --bs-table-bg: var(--clearcare-primary);
    --bs-table-color: white;
}

.table-primary th {
    background: linear-gradient(135deg, var(--clearcare-primary), var(--clearcare-secondary));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--clearcare-dark);
}

/* ===== CARDS ===== */
.card {
    border: 1px solid #C2C2C2;
    box-shadow: none;
    border-radius: 6px;
}

.card-header {
    background: linear-gradient(135deg, var(--clearcare-primary), var(--clearcare-secondary));
    color: white;
    font-weight: 600;
    border-bottom: none;
}

/* ===== DASHBOARD STATS ===== */
.stat-card {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    border: 1px solid #C2C2C2;
    box-shadow: none;
    border-left: 4px solid var(--clearcare-primary);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--clearcare-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

/* ===== FORM CONTROLS ===== */
.form-control:focus,
.form-select:focus {
    border-color: var(--clearcare-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 229, 255, 0.25);
}

.form-control.required {
    border-color: #E91E63;
}

.form-control.required:focus {
    border-color: #E91E63;
    box-shadow: 0 0 0 0.2rem rgba(233, 30, 99, 0.25);
}

/* ===== STATUS BADGES ===== */
.badge.bg-success {
    background-color: var(--status-success) !important;
}

.badge.bg-warning {
    background-color: var(--status-warning) !important;
}

.badge.bg-danger {
    background-color: var(--status-error) !important;
}

.badge.bg-info {
    background-color: var(--status-info) !important;
}

/* ===== WATER TESTING INTERFACE ===== */
.parameter-input {
    text-align: center;
    font-weight: 600;
}

.parameter-input.parameter-good {
    border-color: var(--status-success);
    background-color: rgba(76, 175, 80, 0.1);
}

.parameter-input.parameter-warning {
    border-color: var(--status-warning);
    background-color: rgba(255, 152, 0, 0.1);
}

.parameter-input.parameter-critical {
    border-color: var(--status-error);
    background-color: rgba(244, 67, 54, 0.1);
}

/* ===== CUSTOMER NOTES ===== */
.customer-notes-container {
    max-width: 1200px;
    margin: 0 auto;
}

.notes-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-item {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    border: 1px solid #C2C2C2;
    box-shadow: none;
    border-left: 4px solid var(--clearcare-primary);
}

.note-header {
    margin-bottom: 1rem;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.note-date {
    font-weight: 600;
    color: var(--clearcare-dark);
}

.note-author {
    color: #6c757d;
    font-size: 0.875rem;
}

.note-type {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.note-type.service {
    background: #E8F5E8;
    color: #2E7D32;
}

.note-type.maintenance {
    background: #E3F2FD;
    color: #1976D2;
}

.note-type.billing {
    background: #FFF3E0;
    color: #F57C00;
}

.note-type.issue {
    background: #FFEBEE;
    color: #D32F2F;
}

.note-content p {
    color: var(--clearcare-dark);
    line-height: 1.6;
    margin: 0;
}

.customer-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #C2C2C2;
    box-shadow: none;
}

.summary-card h3 {
    color: var(--clearcare-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--clearcare-primary);
    padding-bottom: 0.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item label {
    font-weight: 600;
    color: #6c757d;
}

.summary-item span {
    color: var(--clearcare-dark);
    text-align: right;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #E8F5E8;
    color: #2E7D32;
}

.status-badge.inactive {
    background: #FFF3E0;
    color: #F57C00;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #12e8d4;
    border-radius: 6px;
}

.no-customer {
    text-align: center;
    padding: 3rem;
}

.no-customer h3 {
    color: var(--clearcare-dark);
    margin-bottom: 1rem;
}

.no-customer p {
    color: #6c757d;
    margin-bottom: 2rem;
}

/* ===== CONTAINER MANAGEMENT ===== */
.container-type.pool {
    background: rgba(33, 150, 243, 0.2);
    color: #1976D2;
}

.container-type.spa {
    background: rgba(156, 39, 176, 0.2);
    color: #7B1FA2;
}

/* ===== SETTINGS PAGE ===== */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: white;
    border-radius: 6px;
    border: 1px solid #C2C2C2;
    box-shadow: none;
    padding: 2rem;
    margin-bottom: 2rem;
}

.settings-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--clearcare-dark);
    border-bottom: 2px solid var(--clearcare-primary);
    padding-bottom: 0.5rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: var(--clearcare-dark);
}

.parameter-ranges {
    margin-bottom: 1.5rem;
}

.range-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.range-group label {
    min-width: 150px;
    font-weight: 600;
    color: var(--clearcare-dark);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-inputs input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
}

.range-inputs span {
    color: #6c757d;
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 1rem;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

.data-actions {
    display: grid;
    gap: 1.5rem;
}

.action-group {
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
}

.action-group.danger-zone {
    border-color: var(--status-error);
    background: #fff5f5;
}

.action-group h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.action-group p {
    margin-bottom: 1rem;
    color: #6c757d;
}

.about-info {
    color: #6c757d;
    line-height: 1.6;
}

.about-info p {
    margin-bottom: 0.5rem;
}

.about-info strong {
    color: var(--clearcare-dark);
}

/* ===== TEST DETAIL PAGE ===== */
.test-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.info-card {
    background: white;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 6px;
    border: 1px solid #C2C2C2;
    box-shadow: none;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ===== CONTAINER DETAIL PAGE ===== */
.container-detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
}

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

.simple-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* ===== CUSTOMER DETAIL PAGE ===== */
.customer-detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

.container-item {
    border: 1px solid #eee;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
}

/* ===== CUSTOMER OPTIONS PAGE ===== */
.customer-options-container {
    max-width: 1000px;
    margin: 0 auto;
}

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

.option-card {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px solid #C2C2C2;
    box-shadow: none;
}

.option-card h3 {
    color: var(--clearcare-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--clearcare-primary);
    padding-bottom: 0.5rem;
}

.option-item {
    margin-bottom: 1rem;
}

.option-item:last-child {
    margin-bottom: 0;
}

.option-item label {
    display: block;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

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

.checkbox-wrapper input[type="checkbox"] {
    margin-right: 0.5rem;
}

.checkbox-label {
    font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .customer-tabs .nav-link {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .range-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .range-inputs span {
        text-align: center;
        margin: 0.25rem 0;
    }
}

@media (max-width: 576px) {
    .customer-tabs {
        padding: 0;
    }
    
    .customer-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .settings-container {
        margin: 0 1rem;
    }
    
    .settings-section {
        padding: 1.5rem;
    }
    
    .range-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .range-group label {
        min-width: auto;
    }
    
    .range-inputs {
        align-self: stretch;
        justify-content: center;
    }
    
    .range-inputs input {
        flex: 1;
        max-width: 100px;
    }
}

@media (max-width: 1024px) {
    .notes-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .customer-summary {
        order: -1;
    }
}

@media (max-width: 768px) {
    .note-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .summary-item span {
        text-align: left;
    }
}

/* ===== NOTIFICATION SYSTEM ===== */
.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 400px;
}

.notification {
    margin-bottom: 0.75rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
    overflow: hidden;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.75rem;
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Notification Types */
.notification-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notification-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.notification-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
}

/* ===== MODAL CUSTOMIZATION ===== */
.modal-content {
    border: 1px solid #C2C2C2;
    box-shadow: none;
    border-radius: 6px;
}

.modal-header {
    background: linear-gradient(135deg, var(--clearcare-primary), var(--clearcare-secondary));
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* ===== GRADIENT HEADERS ===== */
.gradient-header {
    background: linear-gradient(to bottom, #D9ECFF, #B9D9F8);
    color: #003366;
    font-weight: 600;
    padding: 1rem 1.5rem;
    margin: 0;
    border-radius: 6px 6px 0 0;
}

/* ===== UTILITY CLASSES ===== */
.text-clearcare {
    color: var(--clearcare-primary) !important;
}

.bg-clearcare {
    background-color: var(--clearcare-primary) !important;
}

.border-clearcare {
    border-color: var(--clearcare-primary) !important;
}

.text-clearcare-dark {
    color: var(--clearcare-dark) !important;
}

.bg-clearcare-dark {
    background-color: var(--clearcare-dark) !important;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-clearcare {
    color: var(--clearcare-primary);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ===== FOCUS STATES ===== */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 229, 255, 0.25);
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .customer-tabs,
    .top-header {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
