/* Client Portal Styles */

:root {
    --client-primary: #3498db;
    --client-secondary: #2c3e50;
    --client-success: #27ae60;
    --client-warning: #f39c12;
    --client-danger: #e74c3c;
    --client-info: #17a2b8;
    --client-light: #ecf0f1;
    --client-dark: #2c3e50;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    border-radius: 5px;
    margin: 0 5px;
    transition: background-color 0.3s;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: var(--client-secondary);
    border-radius: 10px 10px 0 0 !important;
}

/* Statistics Cards */
.stat-card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    opacity: 0.8;
}

/* Activity Timeline */
.activity-timeline {
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    margin-bottom: 20px;
    position: relative;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 15px;
    flex-shrink: 0;
}

.activity-content h6 {
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--client-secondary);
}

.activity-content p {
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Guard Status */
.guard-status-item {
    padding: 10px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.guard-status-item:hover {
    background-color: #e9ecef;
}

/* Billing Styles */
.billing-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.billing-detail .label {
    font-weight: 600;
    color: var(--client-secondary);
}

.billing-detail .value {
    font-weight: 500;
    color: var(--client-primary);
}

.billing-total {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--client-light);
    border: none;
    font-weight: 600;
    color: var(--client-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.table-responsive {
    border-radius: 10px;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

/* Forms */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: var(--client-primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
}

.form-select:focus {
    border-color: var(--client-primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--client-success);
    background-color: rgba(39, 174, 96, 0.1);
}

.alert-danger {
    border-left-color: var(--client-danger);
    background-color: rgba(231, 76, 60, 0.1);
}

.alert-warning {
    border-left-color: var(--client-warning);
    background-color: rgba(243, 156, 18, 0.1);
}

.alert-info {
    border-left-color: var(--client-info);
    background-color: rgba(23, 162, 184, 0.1);
}

/* Map Styles */
#guardMap {
    border-radius: 10px;
    z-index: 1;
}

.leaflet-container {
    border-radius: 10px;
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 15px 15px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    .stat-card .card-body {
        padding: 1.5rem 1rem;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 8px;
        margin-bottom: 5px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .activity-content h6 {
        font-size: 0.9rem;
    }

    .activity-content p {
        font-size: 0.8rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--client-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Status Indicators */
.status-online {
    color: var(--client-success);
}

.status-offline {
    color: #6c757d;
}

.status-warning {
    color: var(--client-warning);
}

.status-danger {
    color: var(--client-danger);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .container-fluid {
        margin: 0;
        padding: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #fff;
    }

    .card {
        background-color: #2d2d2d;
        color: #fff;
    }

    .table {
        background-color: #2d2d2d;
        color: #fff;
    }

    .form-control {
        background-color: #2d2d2d;
        border-color: #444;
        color: #fff;
    }

    .form-control:focus {
        background-color: #2d2d2d;
        border-color: var(--client-primary);
        color: #fff;
    }
}