/* =======================================================
   === SHARED LAYOUT STYLES ===
   ======================================================= */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === Navbar Styles === */
.navbar-brand img { height: 40px; }
.bg-footer-color { background-color: #212121 !important; }
.nav-link-custom-color {
    color: #9E8A2F !important; 
    text-decoration: none;
    padding-bottom: 5px;
    border-bottom: 3px solid transparent; 
    border-radius: 0 !important;          
    transition: border-color 0.2s ease;   
}
.nav-link-custom-color:hover, .nav-link-custom-color:focus, .nav-link-custom-color.active {
    border-bottom-color: #9E8A2F; 
}
.dropdown-toggle::after { color: #9E8A2F; vertical-align: middle; }
.dropdown-menu { background-color: #9E8A2F !important; border-radius: 0 !important; margin-top: 0; }
.dropdown-item-custom-color { color: #ffffff !important; }
.dropdown-item-custom-color:hover { background-color: #7a6b24 !important; color: #ffffff !important; }

/* --- BUTTONS --- */
.btn-custom {
    background-color: #9E8A2F !important; 
    color: #ffffff !important;            
    border: none;
    padding: 0.45rem 1rem;
    font-weight: bold;
    border-radius: 3px;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;                
}
.btn-custom:hover { background-color: #7a6b24 !important; color: #ffffff !important; }

/* === Utility Classes === */
.text-custom-color { color: #9E8A2F !important; font-weight: bold !important; }
.mb-extra-large { margin-bottom: 7rem; }
.mt-extra-large { margin-top: 8rem; }

/* === Footer === */
.footer { color: #f8f9fa; background-color: #212121; padding-top: 5rem !important; padding-bottom: 5rem !important; }
.footer a { color: rgba(255, 255, 255, 0.75); text-decoration: none; }
.footer a:hover { color: white; }
.footer a.text-white-50 { transition: color 0.3s ease; }
.footer a.text-white-50:hover { color: #ffffff !important; }

/* =========================================
   === GALLERY PAGE SPECIFIC STYLES ===
   ========================================= */
.btn-filter-dropdown {
    background-color: transparent; border: 2px solid #9E8A2F; color: #9E8A2F;
    font-weight: bold; margin: 0 5px; padding: 0.4rem 1.2rem;
    border-radius: 3px; transition: all 0.3s ease; text-align: left;
}
.btn-filter-dropdown:hover, .btn-filter-dropdown.active, .btn-filter-dropdown.show { 
    background-color: transparent !important; color: #9E8A2F !important; border-color: #9E8A2F; box-shadow: none;
}
#filter-controls .dropdown .dropdown-item { background-color: transparent; color: #9E8A2F; padding: 0.4rem 1.2rem; text-align: left; width: 100%; }
#filter-controls .dropdown .dropdown-item:hover, #filter-controls .dropdown .dropdown-item.active { background-color: #9E8A2F !important; color: #ffffff !important; }
#filter-controls .dropdown .dropdown-menu { width: 100% !important; min-width: 100% !important; margin-top: -2px; border: 2px solid #9E8A2F; border-top: none; border-radius: 0 0 3px 3px; padding: 0; background-color: #fff !important; }

.gallery-card { border: none; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.gallery-card:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important; }
.gallery-card .card-img-top { cursor: pointer; transition: transform 0.4s ease; }
.gallery-card:hover .card-img-top { transform: scale(1.05); }
.gallery-card .card-title { font-weight: bold; color: #333; }
.gallery-card .card-text { color: #666; font-size: 0.9rem; }
.gallery-card .card-date { display: flex; align-items: center; }

.gallery-item.hide { display: none; animation: fadeOut 0.5s; }
.gallery-item.show { animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.pagination .page-link { color: #9E8A2F; border: 1px solid #eee; margin: 0 2px; border-radius: 3px; transition: box-shadow 0.1s ease-in-out; }
.pagination .page-link:hover { background-color: #f8f5e9; color: #7a6c24; }
.pagination .page-item.active .page-link { background-color: #9E8A2F; border-color: #9E8A2F; color: #ffffff; }
.pagination .page-item.disabled .page-link { color: #ccc; background-color: #fafafa; border-color: #eee; }
.pagination .page-link:focus { box-shadow: none; }

/* =========================================
   === HEADER BANNER STYLES ===
   ========================================= */
.header-banner { height: 100vh !important; min-height: 100vh; background-size: cover; background-position: center; background-repeat: no-repeat; display: flex; align-items: center; justify-content: center; position: relative; }
.header-banner::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); z-index: 1; }
.header-banner h1 { text-shadow: 0px 4px 15px rgba(0, 0, 0, 0.6); position: relative; z-index: 2; }
.header-title { font-size: 7rem !important; font-weight: 700; }
.header-subtitle { font-size: 1.5rem !important; color: #dcdcdc; margin-top: 0.5rem; margin-bottom: 0; position: relative; z-index: 2; }

/* =========================================
   === MODAL / CAROUSEL STYLES ===
   ========================================= */
.modal-fullscreen .modal-content { background-color: rgba(0, 0, 0, 0.95); border: none; position: relative; }
.modal-fullscreen .modal-body { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; overflow: hidden; padding: 0 !important; }
.modal-image-container { position: relative; display: inline-block; max-width: 75vw; }
.modal-fullscreen #modalImage { max-height: 75vh; max-width: 100%; width: auto; height: auto; object-fit: contain; border-radius: 15px; box-shadow: 0 0 30px rgba(0,0,0,0.8); transition: opacity 0.2s ease-in-out; display: block; }
.modal-header-custom { position: absolute; top: 0; left: 0; width: 100%; z-index: 1050; background: transparent; pointer-events: none; }
.modal-header-custom .text-start { pointer-events: auto; padding-top: 30px; padding-left: 40px; }
.modal-close-custom { position: absolute; top: 30px; right: 30px; background-color: transparent !important; border: 2px solid #999 !important; border-radius: 5px !important; width: 40px; height: 40px; padding: 0 !important; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23999999'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important; background-size: 14px 14px !important; background-position: center !important; background-repeat: no-repeat !important; opacity: 1 !important; transition: all 0.2s ease; pointer-events: auto; z-index: 1060; }
.modal-close-custom:hover { border-color: #fff !important; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important; }
.modal-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 45px; height: 45px; font-size: 1.5rem; border-radius: 50%; background-color: rgba(255, 255, 255, 0.15); border: 2px solid rgba(255, 255, 255, 0.4); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1060; transition: all 0.3s ease; }
.modal-nav-btn:hover { background-color: rgba(255, 255, 255, 0.4); border-color: #fff; transform: translateY(-50%) scale(1.1); }
.nav-prev { left: 10px; } 
.nav-next { right: 10px; }
.modal-indicators { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 1060; }
.indicator-line { width: 40px; height: 3px; background-color: rgba(255, 255, 255, 0.5); border-radius: 2px; cursor: pointer; transition: background-color 0.3s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.indicator-line.active { background-color: #ffffff; }
#modalDate { font-size: 1rem; font-weight: 400; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); opacity: 1; }
#modalDate, #modalDate * { color: #ffffff !important; }
.social-icon-btn { width: 50px; height: 50px; background-color: #9E8A2F; color: #ffffff; font-size: 1.5rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; text-decoration: none; transition: background-color 0.3s ease; border: none; }
.social-icon-btn:hover { background-color: #7a6b24; color: #ffffff; }

@media (max-width: 768px) {
    .modal-nav-btn { display: none !important; }
    .indicator-line { width: 15px !important; height: 2px !important; }
    .modal-indicators { bottom: 10px !important; gap: 5px !important; }
    .header-title { font-size: 3.5rem !important; }
    .header-subtitle { font-size: 1.1rem !important; }
    .header-banner h1 { font-size: 3.5rem !important; }
    .gallery-section h2.display-5, .gallery-section h2.display-3 { font-size: 2.2rem !important; }
    .footer .text-center { text-align: left !important; }
    .footer .d-flex.justify-content-center { justify-content: flex-start !important; }
}

/* ========================================================
   === UPLOAD & PREVIEW STYLES (NEW) ===
   ======================================================== */

/* Dashed Box Layout */
.dashed-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    background-color: #fcfcfc;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column; /* Stacked Layout */
    gap: 15px;              /* Space between Input and Preview */
}

.dashed-drop-zone:hover {
    border-color: #9E8A2F; 
    background-color: #fffbf0;
}

/* Make "Choose File" button fit width */
.dashed-drop-zone input[type="file"] {
    width: 100%;
    box-sizing: border-box;
}

/* Unified List (Wraps both Existing and New images) */
.unified-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

/* Virtual Container: Makes new images sit inline with existing */
.virtual-container {
    display: contents; 
}

/* Preview Box Style */
.preview-box {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* X Button Style */
.preview-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 18px; 
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-remove-btn:hover {
    background-color: #cc0000;
}