﻿/* Carrier Benchmark Portal - Lightweight CSS */
/* Optimized for low memory usage */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e40af;
    --primary-hover: #3b82f6;
    --primary-dark: #1e3a8a;
    --danger-color: #dc3545;
    --success-color: #22c55e;
    --warning-color: #ffc107;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: var(--gray-100);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-menu a:hover {
    background: var(--primary-hover);
}

/* Notification Bell */
.notification-bell-container {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.notification-bell:hover {
    background: var(--primary-hover);
}

.bell-icon {
    font-size: 20px;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    min-width: 150px;
    margin-top: 5px;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    color: #333;
    padding: 10px 15px;
}

.nav-dropdown-menu a:hover {
    background: var(--gray-100);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 150px);
    padding: 30px 0;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 450px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.auth-header h2 {
    font-size: 24px;
    color: var(--gray-800);
}

.auth-header p {
    color: var(--gray-600);
    margin-top: 10px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--gray-800);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: var(--gray-600);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-800);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 20px;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-800);
}

.table tr:hover {
    background: var(--gray-100);
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Progress Bar */
.progress {
    height: 20px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: #333;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-secondary {
    background: var(--gray-600);
    color: white;
}

/* Footer */
.footer {
    background: white;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 14px;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.gap-10 {
    gap: 10px;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 14px;
    }

    .table th,
    .table td {
        padding: 8px;
    }
}

/* Signature Pad */
.signature-canvas {
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    cursor: crosshair;
    touch-action: none;
}

.signature-pad {
    margin: 20px 0;
}

.signature-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Document Viewer */
.document-viewer {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.document-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 20px;
    border-top: 2px solid var(--gray-200);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Loading */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Compliance Health Score Color Coding */
.health-score-green {
    background: #22c55e !important; /* Green: 90-100% */
}

.health-score-yellow {
    background: #facc15 !important; /* Yellow: 70-89% */
}

.health-score-orange {
    background: #f97316 !important; /* Orange: 50-69% */
}

.health-score-red {
    background: #ef4444 !important; /* Red: <50% */
}

.perfect-score-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    font-weight: bold;
    animation: checkmark-pulse 2s ease-in-out infinite;
}

@keyframes checkmark-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--gray-300);
}

.pagination-info {
    color: var(--gray-600);
    font-size: 14px;
}

.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-link {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination-link:hover:not(.disabled):not(.active) {
    background: var(--gray-100);
    border-color: var(--primary-color);
}

.pagination-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.pagination-link.disabled {
    color: var(--gray-600);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}
