/* TreeDeck Custom Styles */

/* Z-index hierarchy for proper layering */
header {
    z-index: 1000 !important; /* Ensure header is always on top */
}

.leaflet-container {
    z-index: 10 !important; /* Map container */
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
    z-index: 50 !important; /* Map controls */
}

/* Custom utility classes */
.tree-card {
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

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

.tree-image-container {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.tree-image-container img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Dropzone custom styles */
.dropzone {
    border: 2px dashed #3e9947;
    border-radius: 0.5rem;
    background: #f0f9f1;
}

.dropzone:hover {
    background: #dcf1de;
}

.dropzone .dz-message {
    color: #3e9947;
}

/* Custom animation for tree growth visualization */
@keyframes growTree {
    from {
        height: 0;
        opacity: 0;
    }
    to {
        height: 100%;
        opacity: 1;
    }
}

.tree-growth-indicator {
    animation: growTree 1.5s ease-out forwards;
}

/* Seasonal colors for tree health status */
.season-spring {
    background-color: #dcf1de;
    border-color: #8fd096;
}

.season-summer {
    background-color: #3e9947;
    border-color: #26632d;
    color: white;
}

.season-fall {
    background-color: #ff9a3c;
    border-color: #e67700;
}

.season-winter {
    background-color: #e6f0f5;
    border-color: #a5c5d5;
}

/* Custom scrollbar for tree lists */
.tree-list::-webkit-scrollbar {
    width: 8px;
}

.tree-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tree-list::-webkit-scrollbar-thumb {
    background: #3e9947;
    border-radius: 10px;
}

.tree-list::-webkit-scrollbar-thumb:hover {
    background: #2d7c35;
}

/* Search input custom styles */
.search-input:focus {
    box-shadow: 0 0 0 3px rgba(62, 153, 71, 0.3);
    border-color: #3e9947;
}

/* Custom badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
}

.badge-primary {
    background-color: #3e9947;
    color: white;
}

.badge-secondary {
    background-color: #f0f9f1;
    color: #3e9947;
    border: 1px solid #3e9947;
}

/* Header Navigation Buttons */
.header-btn {
    border-radius: 0.75rem !important;
    padding: 0.5rem 1rem !important; 
    font-size: 0.875rem !important;
    box-shadow: 0 4px 6px -1px rgba(45, 124, 53, 0.15) !important;
    transition: all 0.2s !important;
}

.header-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px -3px rgba(45, 124, 53, 0.2) !important;
}

/* TreeDeck Button Styles */
.treedeck-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(45, 124, 53, 0.15);
    transition: all 0.2s;
}

.treedeck-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(45, 124, 53, 0.2);
}

.btn-green {
    background-color: #3e9947;
    color: white;
}

.btn-white {
    background-color: white;
    color: #3e9947;
    border: 1px solid #3e9947;
}

.indicator-dot {
    margin-left: 0.25rem;
    height: 0.375rem;
    width: 0.375rem;
    border-radius: 9999px;
    background-color: white;
    opacity: 0.8;
}

/* Button style overrides */
.btn-login {
    background-color: white !important;
    color: #3e9947 !important;
    border: 1px solid #3e9947 !important;
}

.btn-green {
    background-color: #3e9947 !important;
    color: white !important;
    border: 1px solid #2d7c35 !important;
}

/* Custom spacing overrides */
.mt-2 {
    margin-top: 1.5rem !important;
}

/* Feature item styles */
.feature-item {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
    text-align: left;
    padding-left: 1rem;
}

/* Style the checkmark */
.feature-item::first-letter {
    color: #3e9947;
    font-weight: bold;
}

/* Standardized animation for all pages */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-15px) rotate(-5deg); }
    50% { transform: translateY(0) rotate(0); }
    75% { transform: translateY(15px) rotate(5deg); }
}
.animate-float {
    animation: float 8s ease-in-out infinite;
}

/* Text truncation utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Alpine.js utilities */
[x-cloak] { 
    display: none !important; 
}

/* Map page animations and styling */
@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-bounce-slow {
    animation: bounce-slow 6s infinite;
}

/* Map marker pulse effect */
.tree-marker {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    border: 2px solid #4ade80;
    box-shadow: 0 0 0 rgba(74, 222, 128, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

/* User location pulse animation */
@keyframes user-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Apply the animation to the user location */
.bg-blue-500.pulse {
    animation: user-pulse 2s infinite;
}

/* Custom popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 1rem;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
    min-width: 200px;
}

.tree-popup {
    display: flex;
    flex-direction: column;
}

.tree-popup-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.tree-popup-content {
    padding: 0.75rem;
}

/* Smooth hover transition for tree cards */
.tree-card {
    transition: all 0.3s ease;
    transform: translateY(0);
}

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

/* Filter tag styles for search page */
.filter-tag {
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background-color: #3e9947;
    color: white;
}

/* Form styling for tree/add.php */
.dropzone {
    border: 2px dashed rgba(74, 222, 128, 0.4) !important;
    background: rgba(74, 222, 128, 0.05) !important;
    border-radius: 1rem !important;
    min-height: 150px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

.dropzone:hover {
    border-color: rgba(74, 222, 128, 0.8) !important;
    background: rgba(74, 222, 128, 0.1) !important;
}

.dropzone .dz-message {
    margin: 0 !important;
    font-size: 1.2rem !important;
    color: #10b981 !important;
}

/* Modal transitions */
#measurementGuideModal .bg-white {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.2s ease-out;
}

#measurementGuideModal .bg-white.scale-100 {
    transform: scale(1);
    opacity: 1;
}

/* Pulse animation for location button */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.animate-pulse {
    animation: pulse 1.5s infinite;
}

/* Admin Area Styles */

/* Code editor for admin scripts */
.code-editor {
    tab-size: 4;
    font-family: monospace;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.75rem;
    color: #212529;
    line-height: 1.5;
}

/* Basic form styles for admin test pages */
.basic-form {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.basic-form .form-group {
    margin-bottom: 20px;
}

.basic-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.basic-form input[type="text"],
.basic-form input[type="email"],
.basic-form input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.basic-form .checkbox-group {
    display: flex;
    align-items: center;
}

.basic-form .checkbox-group label {
    margin-left: 10px;
    font-weight: normal;
}

.basic-form button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.basic-form button:hover {
    background-color: #45a049;
}

.basic-form .message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.basic-form .message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Progress bars for admin stats */
.admin-progress-container {
    height: 0.625rem;
    overflow: hidden;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.admin-progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: currentColor;
    transition: width 0.6s ease;
    height: 100%;
}

.admin-progress-bar-green {
    color: #4CAF50;
}

.admin-progress-bar-blue {
    color: #3b82f6;
}

.admin-progress-bar-purple {
    color: #8b5cf6;
}

/* Form styling for edit_tree.php */
.form-section {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.form-input-field {
    background-color: white !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s ease !important;
}

.form-input-field:focus {
    border-color: #3e9947 !important;
    box-shadow: 0 0 0 3px rgba(62, 153, 71, 0.2) !important;
    outline: none !important;
}

/* Segmented progress bars for opcache_status */
.segmented-progress-container {
    overflow: hidden;
    height: 2rem;
    margin-bottom: 0.25rem;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border-radius: 0.5rem;
}

.segment-green {
    background-color: #4CAF50;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

.segment-yellow {
    background-color: #ffca28;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

.segment-gray {
    background-color: #f1f1f1;
    color: #5a5a5a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

.segment-blue {
    background-color: #3b82f6;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

.segment-purple {
    background-color: #8b5cf6;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition: width 0.6s ease;
}

/* Tree Comment Styles */
.tree-comment-text {
    text-align: left !important;
    word-break: break-word;
    padding: 0.75rem;
    line-height: 1.5;
    border: 1px solid rgba(62, 153, 71, 0.1);
}

/* Style for comment form textarea */
textarea[name="comment_text"], 
textarea[name="comment"] {
    text-align: left !important;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Comment button styles */
button[name="add_comment"],
button[name="edit_comment"] {
    text-align: center !important;
}

button[name="add_comment"] span,
button[name="edit_comment"] span,
button[onclick*="cancelEditComment"] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile optimizations for comments */
@media (max-width: 640px) {
    .tree-comment-text {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    textarea[name="comment_text"], 
    textarea[name="comment"] {
        min-height: 60px;
        font-size: 0.875rem;
    }
    
    button[name="add_comment"] {
        width: 100%;
        justify-content: center;
    }
}

/* Custom page-specific overrides */
/* This specifically targets the tree view header to move the badge up */
.tree-view-header {
    padding-top: 2rem !important; /* Reduce from default 3rem (py-12) to 2rem */
}

/* Splash screen hidden content class */
.hidden-content {
    display: none; /* Hide main content until splash screen is complete */
}

/* Leaflet Map Styling */
.map-container {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.tree-popup-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.75rem;
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000 !important;
    background-color: white;
    padding: 10px;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content-wrapper {
    border-radius: 1rem !important;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 250px !important;
}

.tree-popup-content {
    padding: 12px;
    background-color: white;
}

.leaflet-popup-content a {
    background-color: #2d7c35 !important; /* Darker green button */
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    font-weight: bold !important;
    letter-spacing: 0.02em !important;
    color: white !important;
    padding: 4px 12px !important;
}

.leaflet-popup-content a:hover {
    background-color: #1e4223 !important; /* Even darker on hover */
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.4) !important;
}

.tree-marker {
    background-color: white;
    border-radius: 50%;
    border: 2px solid #3c9945;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    width: 30px;
    height: 30px;
    font-size: 21px;
}

/* Make the tree markers pulse with animation - duplicate removed since we already have this defined */
