/* Enviro Monitoring System v1.0 - Main Stylesheet */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Header & Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.navbar-brand i {
    color: #27ae60;
    margin-right: 8px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
    padding: 15px 20px;
}

.card-header.bg-primary { background: linear-gradient(45deg, #3498db, #2980b9) !important; }
.card-header.bg-success { background: linear-gradient(45deg, #27ae60, #219653) !important; }
.card-header.bg-info { background: linear-gradient(45deg, #17a2b8, #138496) !important; }
.card-header.bg-warning { background: linear-gradient(45deg, #f39c12, #e67e22) !important; }

/* Table Styles */
.table-container {
    overflow-x: auto;
    max-height: 70vh;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 2000px;
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 12px 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-right: 1px solid #3a506b;
    white-space: nowrap;
}

.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eaeaea;
    border-right: 1px solid #eaeaea;
    vertical-align: middle;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:hover {
    background-color: #f0f7ff;
}

.row-number {
    background-color: #34495e;
    color: white;
    font-weight: bold;
    text-align: center;
    min-width: 60px;
    position: sticky;
    left: 0;
    z-index: 90;
}

.description-cell {
    min-width: 350px;
    position: sticky;
    left: 60px;
    background-color: white;
    z-index: 80;
    font-weight: 500;
}

.plan-cell {
    background-color: #f8f9fa;
    font-weight: 500;
    min-width: 120px;
    position: sticky;
    left: 410px;
    z-index: 80;
}

.month-header {
    background-color: #3498db !important;
    text-align: center;
    font-weight: bold;
    color: white;
}

.quarter-header {
    background-color: #2c3e50 !important;
    text-align: center;
    font-weight: bold;
    color: white;
}

.year-header {
    background-color: #1a252f !important;
    text-align: center;
    font-weight: bold;
    color: white;
}

.week-cell {
    background-color: #f1f8ff;
    text-align: center;
    min-width: 80px;
}

/* Form Controls */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.input-sm {
    padding: 4px 8px;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    border-radius: 5px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.btn-success {
    background: linear-gradient(45deg, #27ae60, #219653);
}

.btn-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.btn-warning {
    background: linear-gradient(45deg, #f39c12, #e67e22);
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
}

/* Dashboard Cards */
.stat-card {
    border: none;
    border-radius: 10px;
    color: white;
    padding: 20px;
    text-align: center;
    height: 100%;
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-card p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-card.bg-success { background: linear-gradient(135deg, #27ae60, #219653) !important; }
.stat-card.bg-info { background: linear-gradient(135deg, #17a2b8, #138496) !important; }
.stat-card.bg-warning { background: linear-gradient(135deg, #f39c12, #e67e22) !important; }
.stat-card.bg-secondary { background: linear-gradient(135deg, #6c757d, #5a6268) !important; }

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 60px;
    color: #27ae60;
    margin-bottom: 15px;
}

.login-logo h2 {
    color: #2c3e50;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .data-table {
        font-size: 12px;
    }
    
    .description-cell {
        min-width: 200px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .table-container {
        max-height: 60vh;
    }
}

@media print {
    .no-print {
        display: none !important;
    }
    
    .table-container {
        overflow: visible !important;
        max-height: none !important;
    }
    
    .data-table {
        min-width: auto;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Badge Styles */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-admin {
    background-color: #e74c3c;
    color: white;
}

.badge-user {
    background-color: #3498db;
    color: white;
}