/* Custom styles for the tree census application */

:root {
    --primary-color: #0d424e;
    --secondary-color: #7fa4c0;
    --background-color: #fafafa;
    --primary-hover: #0a353e;
    --secondary-hover: #6d8ca8;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Touch-friendly buttons for mobile */
.btn-group .btn {
    min-height: 44px;
}

.form-control {
    min-height: 44px;
}

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

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Custom themed elements */
.tree-icon {
    color: var(--primary-color);
}

.nature-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* Map container */
.map-container {
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--bs-border-color);
}

/* Photo preview */
.photo-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 2px dashed var(--bs-border-color);
    object-fit: cover;
}

/* Status badges */
.status-confirmed {
    background-color: var(--primary-color) !important;
}

.status-pending {
    background-color: #ffc107 !important;
}

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Sticky navigation for mobile */
@media (max-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1020;
    }
}

/* Improved form styling */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > label {
    opacity: 0.8;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Progress indicators */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 66, 78, 0.25);
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
    }
    
    .table {
        border: 1px solid #000 !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #000 !important;
    }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #dc3545;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 1000;
    display: none;
}

.offline-indicator.show {
    display: block;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

/* Image zoom on hover */
.image-zoom {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.image-zoom:hover {
    transform: scale(1.05);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive images */
.img-responsive {
    max-width: 100%;
    height: auto;
}

/* Custom button variants */
.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
}

.btn-secondary-custom {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-secondary-custom:hover {
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
    color: white;
}

/* Body background */
body {
    background-color: var(--background-color);
}

/* Override Bootstrap variables */
:root {
    --bs-primary: #0d424e;
    --bs-primary-rgb: 13, 66, 78;
    --bs-secondary: #7fa4c0;
    --bs-secondary-rgb: 127, 164, 192;
    --bs-body-bg: #fafafa;
    --bs-body-bg-rgb: 250, 250, 250;
}

/* Navbar styling */
.navbar-dark {
    background-color: var(--primary-color) !important;
}

.navbar-dark .navbar-brand {
    color: #ffffff;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff;
}

/* Card styling */
.card {
    background-color: #ffffff;
    border: 1px solid rgba(13, 66, 78, 0.125);
}

.card-header {
    background-color: rgba(13, 66, 78, 0.05);
    border-bottom: 1px solid rgba(13, 66, 78, 0.125);
}

/* Table styling */
.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: rgba(13, 66, 78, 0.05);
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
    background-color: rgba(13, 66, 78, 0.075);
}

/* Alert styling */
.alert-primary {
    background-color: rgba(13, 66, 78, 0.1);
    border-color: rgba(13, 66, 78, 0.2);
    color: var(--primary-color);
}

.alert-secondary {
    background-color: rgba(127, 164, 192, 0.1);
    border-color: rgba(127, 164, 192, 0.2);
    color: var(--secondary-color);
}
