/* assets/css/modal_berita.css - Complete with fixed share icons */

/* ========= MODAL OVERLAY ========= */
.modal-berita-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-berita-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========= MODAL CONTAINER ========= */
.modal-berita-container {
    position: relative;
    width: 90%;
    max-width: 950px;
    max-height: 90vh;
    background: white;
    border-radius: 28px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.modal-berita-overlay.active .modal-berita-container {
    transform: scale(1);
}

/* ========= HEADER ========= */
.modal-berita-header {
    padding: 24px 28px;
    background: linear-gradient(135deg, #00FFF0 0%, #0BDA51 100%);
    position: relative;
    flex-shrink: 0;
}

.modal-berita-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a3a2f;
    margin-right: 40px;
    line-height: 1.3;
}

.modal-berita-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #1a3a2f;
}

.modal-berita-close:hover {
    background: white;
    transform: rotate(90deg);
}

/* ========= BODY ========= */
.modal-berita-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

/* ========= META INFO ========= */
.modal-berita-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.modal-berita-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0BDA51;
    font-size: 0.85rem;
    font-weight: 500;
}

.modal-berita-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #00FFF0 0%, #0BDA51 100%);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a3a2f;
}

.modal-berita-views {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b8b7e;
    font-size: 0.75rem;
}

/* ========= IMAGE - FULL VIEW ========= */
.modal-berita-image {
    width: 100%;
    max-height: 400px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-berita-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    object-position: center;
    border-radius: 16px;
    background: #f8fafc;
}

.modal-berita-image i {
    font-size: 64px;
    color: #1a3a2f;
    padding: 40px;
}

/* ========= CONTENT - JUSTIFIED TEXT ========= */
.modal-berita-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #2d5546;
    text-align: justify;
}

.modal-berita-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.modal-berita-content h1,
.modal-berita-content h2,
.modal-berita-content h3 {
    margin: 28px 0 16px;
    color: #1e3a2f;
    text-align: left;
}

.modal-berita-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.modal-berita-content ul,
.modal-berita-content ol {
    margin: 16px 0 16px 28px;
    text-align: justify;
}

.modal-berita-content li {
    margin: 8px 0;
    text-align: justify;
}

.modal-berita-content blockquote {
    border-left: 4px solid #0BDA51;
    padding-left: 20px;
    margin: 20px 0;
    color: #4a6b5e;
    font-style: italic;
    text-align: justify;
}

.modal-berita-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.modal-berita-content th,
.modal-berita-content td {
    border: 1px solid #e2e8f0;
    padding: 10px;
    text-align: left;
}

.modal-berita-content th {
    background: #f8fafc;
    font-weight: 600;
}

/* ========= RECOMMENDED SECTION ========= */
.modal-berita-recommended {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid #e2e8f0;
}

.modal-berita-recommended h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3a2f;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-berita-recommended h4 i {
    color: #0BDA51;
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.recommended-card {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.recommended-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.15);
    border-color: #0BDA51;
}

.recommended-img {
    height: 120px;
    width: 100%;
    background: linear-gradient(135deg, #00FFF0 0%, #0BDA51 100%);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.recommended-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.3s ease;
}

.recommended-card:hover .recommended-img img {
    transform: scale(1.05);
}

.recommended-img i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #1a3a2f;
}

.recommended-content {
    padding: 12px;
}

.recommended-category {
    display: inline-block;
    background: linear-gradient(135deg, #00FFF0 0%, #0BDA51 100%);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 600;
    color: #1a3a2f;
    margin-bottom: 8px;
}

.recommended-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e3a2f;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.recommended-date {
    font-size: 0.65rem;
    color: #0BDA51;
    display: flex;
    align-items: center;
    gap: 4px;
}

.recommended-date i {
    font-size: 0.6rem;
}

/* ========= SHARE SECTION - ICON KECIL ========= */
.share-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.modal-share-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 14px;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    transform: scale(1.05);
}

/* Warna icon sosial media */
.share-btn-wa {
    background: #25D366;
}
.share-btn-wa:hover {
    background: #128C7E;
}

.share-btn-fb {
    background: #1877F2;
}
.share-btn-fb:hover {
    background: #0E5D9E;
}

.share-btn-ig {
    background: linear-gradient(45deg, #f09433, #d62976, #962fbf, #4f5bd5);
}
.share-btn-ig:hover {
    opacity: 0.9;
}

.share-btn-tt {
    background: #000000;
}
.share-btn-tt:hover {
    background: #1a1a1a;
}

.share-btn-x {
    background: #000000;
}
.share-btn-x:hover {
    background: #1a1a1a;
}

.share-btn-copy {
    background: #64748b;
}
.share-btn-copy:hover {
    background: #475569;
}

/* ========= MODAL FOOTER ========= */
.modal-berita-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-close-modal {
    background: #e2e8f0;
    color: #1e3a2f;
    padding: 6px 16px;
    border-radius: 20px;
    border: none;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #cbd5e1;
}

/* ========= LOADING STATE ========= */
.modal-berita-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
}

.modal-berita-loading i {
    font-size: 48px;
    color: #0BDA51;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.modal-berita-loading p {
    color: #4a6b5e;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========= ERROR STATE ========= */
.modal-berita-error {
    text-align: center;
    padding: 60px;
}

.modal-berita-error i {
    font-size: 64px;
    color: #dc2626;
    margin-bottom: 20px;
}

.modal-berita-error p {
    color: #dc2626;
    margin-bottom: 20px;
}

/* ========= RESPONSIVE DESIGN ========= */
@media (max-width: 1024px) {
    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .modal-berita-container {
        width: 95%;
        max-height: 95vh;
        border-radius: 20px;
    }
    
    .modal-berita-header {
        padding: 18px 20px;
    }
    
    .modal-berita-header h3 {
        font-size: 1.2rem;
        margin-right: 35px;
    }
    
    .modal-berita-close {
        top: 14px;
        right: 16px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .modal-berita-body {
        padding: 20px;
    }
    
    .modal-berita-meta {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .modal-berita-image {
        max-height: 250px;
        margin-bottom: 16px;
    }
    
    .modal-berita-image img {
        max-height: 250px;
    }
    
    .modal-berita-content {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    
    .modal-berita-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
    }
    
    .share-section {
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .modal-share-buttons {
        justify-content: center;
    }
    
    .btn-close-modal {
        width: 100%;
        text-align: center;
        padding: 8px 16px;
    }
    
    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .recommended-img {
        height: 100px;
    }
    
    .recommended-title {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .modal-berita-header h3 {
        font-size: 1rem;
    }
    
    .modal-berita-image {
        max-height: 200px;
    }
    
    .modal-berita-image img {
        max-height: 200px;
    }
    
    .modal-berita-meta {
        gap: 8px;
    }
    
    .modal-berita-date,
    .modal-berita-views {
        font-size: 0.7rem;
    }
    
    .modal-berita-category {
        font-size: 0.65rem;
    }
    
    .modal-berita-content {
        font-size: 0.85rem;
    }
    
    .share-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .share-label {
        font-size: 0.7rem;
    }
    
    .recommended-grid {
        grid-template-columns: 1fr;
    }
    
    .recommended-img {
        height: 80px;
    }
}