/* ==========================================
   GLOBAL STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(to bottom left, #e8f8e6, #fff, #cdf5cd);
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px 0;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   HEADER SECTION - DETAIL PAGE
   ========================================== */
.header-section-detail {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* ==========================================
   HEADER SECTION - INDEX/MAIN PAGE
   ========================================== */
.header-section-main {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    padding: 30px 20px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.header-title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-section-main .header-title {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.header-section-main .header-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.header-image-container {
    width: 100%;
    height: 350px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    position: relative;
    overflow: hidden;
}

.header-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.header-content {
    padding: 30px;
}

.cabang-name {
    font-size: 32px;
    font-weight: 700;
    color: #057b41;
    margin-bottom: 10px;
}

.cabang-location {
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.periode-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.badge-periode {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================
   BACK BUTTON - DETAIL PAGE
   ========================================== */
.back-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #15803d;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-button:hover {
    gap: 12px;
    color: #057b41;
}

/* ==========================================
   SEARCH & FILTER SECTION - INDEX PAGE
   ========================================== */
.search-filter-section {
    background: white;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.filter-top {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 15px 45px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.1);
}

.search-box input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #15803d;
    font-size: 18px;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    display: none;
    transition: all 0.2s ease;
}

.search-clear:hover {
    color: #15803d;
}

.search-clear.show {
    display: block;
}

.search-suggestion {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-suggestion.active {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: #f5f5f5;
    color: #15803d;
    font-weight: 600;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* ==========================================
   FILTER BUTTON & MODAL - INDEX PAGE
   ========================================== */
.filter-btn {
    padding: 15px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    color: #15803d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    min-width: 160px;
    justify-content: center;
}

.filter-btn:hover {
    border-color: #15803d;
    background: #f5f5f5;
}

.filter-btn.active {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    color: white;
    border-color: #15803d;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

/* Modal */
.filter-modal {
    background: white;
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    color: white;
    padding: 20px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 25px;
}

.filter-label {
    font-size: 14px;
    font-weight: 700;
    color: #057b41;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label i {
    font-size: 16px;
}

.filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.filter-option {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    white-space: nowrap;
}

.filter-option:hover {
    border-color: #15803d;
    color: #15803d;
}

.filter-option.active {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    color: white;
    border-color: #15803d;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.modal-btn-reset {
    flex: 1;
    padding: 12px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn-reset:hover {
    background: #e0e0e0;
    color: #057b41;
}

/* ==========================================
   CONTENT GRID & SECTIONS
   ========================================== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Gallery Section */
.gallery-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #057b41;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    font-size: 24px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    height: 150px;
    background: linear-gradient(49deg, #15803d21 0%, #22c55e94 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    will-change: transform;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: #002613;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    will-change: opacity;
    text-shadow: -1.4px -1.4px 0 #e4e4e4, 1.5px -1.4px 0 #e4e4e4, -1.4px 1.5px 0 #e4e4e4, 1.5px 1.5px 0 #e4e4e4, 0px -1.4px 0 #e4e4e4, 0px 1.5px 0 #e4e4e4, -1.4px 0px 0 #e4e4e4, 1.5px 0px 0 #e4e4e4;
    text-transform: uppercase;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.info-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.info-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.info-value {
    font-size: 18px;
    font-weight: 700;
    color: #057b41;
}

.progress-bar-container {
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    height: 8px;
    will-change: width;
}

.progress-bar {
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    height: 100%;
    transition: width 0.3s ease;
    will-change: width;
}

/* Description Section */
.description-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    grid-column: 1 / -1;
}

.description-content {
    color: #666;
    line-height: 1.8;
    font-size: 15px;
}

/* ==========================================
   ACTION BUTTONS
   ========================================== */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary-custom {
    flex: 1;
    padding: 15px 25px;
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(21, 128, 61, 0.3);
    color: white;
    text-decoration: none;
}

.btn-secondary-custom {
    flex: 1;
    padding: 15px 25px;
    background: white;
    color: #15803d;
    border: 2px solid #15803d;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-secondary-custom:hover {
    background: #f5f5f5;
    color: #057b41;
    text-decoration: none;
}

/* Share Button Group */
.share-button-group {
    display: flex;
    gap: 0;
    align-items: center;
    flex: 1;
}

.btn-share-main {
    flex: 1;
    padding: 15px 25px;
    background: white;
    color: #15803d;
    border: 2px solid #15803d;
    border-radius: 12px 0 0 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-share-main:hover {
    background: #f5f5f5;
    color: #057b41;
}

.btn-share-copy {
    padding: 15px 20px;
    background: white;
    color: #15803d;
    border: 2px solid #15803d;
    border-left: none;
    border-radius: 0 12px 12px 0;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.btn-share-copy:hover {
    background: #f5f5f5;
    color: #057b41;
}

/* ==========================================
   CARDS GRID - INDEX PAGE
   ========================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.cabang-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cabang-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #057b41;
    margin-bottom: 10px;
}

.card-location {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-stats {
    display: flex;
    gap: 15px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #15803d;
    display: block;
}

.stat-label {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* ==========================================
   EMPTY STATE & JSON DISPLAY
   ========================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.empty-state i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state p {
    color: #999;
    font-size: 16px;
}

.json-display {
    margin-top: 40px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.json-display h3 {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    margin-bottom: 15px;
}

.json-code {
    background: white;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

/* ==========================================
   MODAL FOR GALLERY - DETAIL PAGE
   ========================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    will-change: opacity;
}

.modal-backdrop.active {
    display: flex;
    animation: fadeInModal 0.2s ease-in-out;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    position: relative;
    animation: slideInModal 0.2s ease-in-out;
}

@keyframes slideInModal {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    will-change: opacity;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #057b41;
}

.text-multiple-line {
  white-space: pre-wrap;
  margin-bottom: 0px;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .page-container {
        padding: 0 20px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .description-section,
    .action-buttons {
        grid-column: 1;
    }

    .filter-top {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
        min-width: unset;
    }

    .header-image-container {
        height: 250px;
        font-size: 80px;
    }

    .header-content {
        padding: 20px;
    }

    .cabang-name {
        font-size: 24px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary-custom,
    .btn-secondary-custom,
    .btn-share-main,
    .btn-share-copy {
        width: 100%;
    }

    .share-button-group {
        flex-direction: column;
    }

    .btn-share-main,
    .btn-share-copy {
        border-radius: 12px;
        border: 2px solid #15803d;
    }

    .btn-share-copy {
        border-left: 2px solid #15803d;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gallery-item {
        height: 120px;
    }

    .gallery-label {
        font-size: 11px;
        padding: 8px;
    }

    .header-section {
        border-radius: 15px;
        margin-bottom: 20px;
    }

    .search-filter-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .filter-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-modal {
        width: 95%;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .page-container {
        padding: 0 15px;
    }

    .header-section {
        border-radius: 15px;
    }

    .cabang-name {
        font-size: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .header-content {
        padding: 15px;
    }

    .gallery-section,
    .info-section,
    .description-section {
        padding: 15px;
    }

    .gallery-item {
        height: 100px;
    }

    .gallery-label {
        font-size: 10px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .card-stats {
        gap: 10px;
    }

    .stat-value {
        font-size: 14px;
    }

    .filter-options {
        grid-template-columns: 1fr;
    }

    .json-display {
        display: none;
    }

    .info-item {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .modal-content {
        padding: 15px;
        width: 95%;
    }

    .modal-image {
        max-height: 300px;
    }
}