/**
 * GroundsHQ - Custom Styles
 *
 * Custom CSS for GroundsHQ application.
 * Complements Bootstrap 5.3.8.
 *
 * @package GroundsHQ
 */

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
    --groundshq-primary: #28a745;
    --groundshq-primary-dark: #218838;
    --groundshq-secondary: #6c757d;
    --groundshq-success: #28a745;
    --groundshq-info: #17a2b8;
    --groundshq-warning: #ffc107;
    --groundshq-danger: #dc3545;
    --groundshq-light: #f8f9fa;
    --groundshq-dark: #343a40;

    --client-residential: #28a745;
    --client-commercial: #007bff;
    --client-multi-family: #6f42c1;
}

/* ==========================================================================
   Layout
   ========================================================================== */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar-brand {
    font-weight: 600;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--groundshq-light);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-responsive {
    border-radius: 0.375rem;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-control:focus,
.form-select:focus {
    border-color: var(--groundshq-primary);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-check-input:checked {
    background-color: var(--groundshq-primary);
    border-color: var(--groundshq-primary);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    font-weight: 500;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #664d03;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #0f5132;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #842029;
}

/* ==========================================================================
   Client Types
   ========================================================================== */

.client-type-residential {
    color: var(--client-residential);
}

.client-type-commercial {
    color: var(--client-commercial);
}

.client-type-multi-family {
    color: var(--client-multi-family);
}

/* ==========================================================================
   Statistics Cards
   ========================================================================== */

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .fas {
    opacity: 0.15;
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    font-size: 4rem;
}

/* ==========================================================================
   PIN Display
   ========================================================================== */

.pin-display {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5rem;
    font-size: 2rem;
    font-weight: bold;
}

.pin-masked {
    color: var(--groundshq-secondary);
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

#toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-item a {
    color: var(--groundshq-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    color: var(--groundshq-secondary);
    opacity: 0.5;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-start {
    border-left: 1px solid #dee2e6 !important;
}

.border-end {
    border-right: 1px solid #dee2e6 !important;
}

.border-top {
    border-top: 1px solid #dee2e6 !important;
}

.border-bottom {
    border-bottom: 1px solid #dee2e6 !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .no-print,
    .btn,
    .navbar,
    footer {
        display: none !important;
    }

    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .btn-group-sm > .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}
