/* 
 * pages.css - Shared Components & Reusable Styles extracted from Views
 */

/* ==========================================================================
   Page Loader (_Layout.cshtml)
   ========================================================================== */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Search Modal (_Layout.cshtml)
   ========================================================================== */
.search-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 48, 87, 0.95);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.search-modal-content {
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content {
    transform: translateY(0);
}

.close-search {
    position: absolute;
    top: -60px;
    left: 0;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-search:hover {
    color: var(--secondary-color);
}

.search-modal-form {
    display: flex;
    width: 100%;
    border-bottom: 3px solid white;
    padding-bottom: 10px;
}

.search-modal-form input {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    width: 100%;
    padding: 10px 0;
    outline: none;
    font-family: inherit;
}

.search-modal-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-modal-form button {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0 15px;
}

.search-modal-form button:hover {
    color: var(--secondary-color);
}

/* ==========================================================================
   Document Modal (GisAtlas.cshtml)
   ========================================================================== */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-content-container {
    position: relative;
    margin: auto;
    width: 90%;
    height: 85vh;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation-name: zoomIn;
    animation-duration: 0.4s;
}

.modal-iframe {
    display: none;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    background: white;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

.modal-img {
    display: none;
    max-width: 100%;
    max-height: calc(100% - 60px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

.modal-caption {
    color: white;
    padding: 15px 0 0;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    display: none;
}

@keyframes zoomIn {
    from {transform: translateY(-50%) scale(0.8); opacity: 0;}
    to {transform: translateY(-50%) scale(1); opacity: 1;}
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.close-modal:hover, .close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

/* ==========================================================================
   Image & Video Lightbox (Details.cshtml, Gallery.cshtml, VideoLibrary.cshtml)
   ========================================================================== */
.lightbox, .video-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.close-lightbox, .close-video-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-lightbox:hover, .close-lightbox:focus, 
.close-video-modal:hover, .close-video-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.prev-lightbox, .next-lightbox {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.6s ease;
    border-radius: 3px 0 0 3px;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    text-decoration: none;
}

.next-lightbox { left: 5%; border-radius: 3px 0 0 3px; }
.prev-lightbox { right: 5%; border-radius: 0 3px 3px 0; }

.prev-lightbox:hover, .next-lightbox:hover {
    background-color: rgba(0,0,0,0.8);
    color: white;
}

#lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    height: 150px;
    font-size: 18px;
}

/* ==========================================================================
   Modern Select (Projects/Index.cshtml)
   ========================================================================== */
.modern-select-wrapper {
    position: relative;
    font-family: inherit;
}

.select-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.modern-select {
    position: relative;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.modern-select:hover {
    border-color: var(--secondary-color);
}

.modern-select.open {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 91, 150, 0.1); /* Primary color glow */
    z-index: 100;
}

.select-trigger {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.select-text {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-count {
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 20px;
}

.select-arrow {
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.modern-select.open .select-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 105;
    border: 1px solid var(--border-color, #eee);
    overflow: hidden;
}

.modern-select.open .select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-search {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.select-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 10px 0;
}

.select-options::-webkit-scrollbar {
    width: 6px;
}

.select-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.select-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.select-option {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 15px;
    color: var(--text-dark);
}

.select-option:hover {
    background: var(--bg-lighter, #f8f9fa);
}

.filter-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    direction: ltr; /* specific to handle the checkbox check icon properly */
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 6px;
    margin-left: 15px; /* RTL margin */
    margin-right: 15px; /* LTR margin */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.select-option:hover input ~ .checkbox-custom {
    border-color: var(--secondary-color);
}

.filter-checkbox:checked ~ .checkbox-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-custom:after {
    content: "";
    display: none;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.filter-checkbox:checked ~ .checkbox-custom:after {
    display: block;
}

/* ==========================================================================
   News Index Filters (Index.cshtml)
   ========================================================================== */
.filter-btn {
    padding: 8px 20px;
    background: white;
    border: 2px solid #eee;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Reusable Utility Classes
   ========================================================================== */
.info-card {
    background: white; 
    padding: 40px; 
    border-radius: var(--radius-card); 
    box-shadow: var(--shadow);
}

.info-card-blue {
    border-right: 5px solid #007bff;
}

.info-card-green {
    border-right: 5px solid #28a745;
}

.info-card-grey {
    border-right: 5px solid #6c757d;
}

.icon-box {
    background: var(--bg-lighter); 
    width: 70px; 
    height: 70px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0;
}

.img-zoom {
    transition: transform 0.3s;
    cursor: pointer;
}

.img-zoom:hover {
    transform: scale(1.03);
}

.img-zoom-large {
    transition: transform 0.4s;
    cursor: pointer;
}

.img-zoom-large:hover {
    transform: scale(1.05);
}
