/* CSS untuk Notifikasi Auto Play - hadits_autoplay.css */

/* Auto play notification */
.auto-play-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 1000;
    display: none;
    animation: slideInRight 0.5s ease-out;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-left: 4px solid #155724;
    max-width: 300px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.auto-play-notification i {
    margin-right: 10px;
    font-size: 1.2em;
    animation: pulse 2s infinite;
}

.auto-play-notification-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.auto-play-notification-progress {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.auto-play-notification-progress-bar {
    height: 100%;
    background: white;
    width: 100%;
    animation: progressBar 3s linear forwards;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes progressBar {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}

/* Notification variants */
.auto-play-notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-left-color: #155724;
}

.auto-play-notification.info {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
    border-left-color: #0c5460;
}

.auto-play-notification.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    border-left-color: #856404;
}

.auto-play-notification.error {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    border-left-color: #721c24;
}

/* Close button */
.auto-play-notification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.auto-play-notification-close:hover {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .auto-play-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auto-play-notification {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .auto-play-notification i {
        font-size: 1em;
        margin-right: 8px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .auto-play-notification {
        box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    }
}

/* Print styles */
@media print {
    .auto-play-notification {
        display: none !important;
    }
}





       /* ===== RESET DAN ISOLASI CSS ===== */
        .hadits-page-isolated * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        .hadits-page-isolated {
            max-width: 100%;
            margin: 0 auto;
            padding: 0;
            background-color: #f5f7fa;
            isolation: isolate;
        }

        /* ===== SISTEM WARNA TAJWID SESUAI BUKU PEDOMAN ===== */
        .tajwid-red { 
            background-color: #FF6B6B !important; 
            color: #000000 !important;
        }

        .tajwid-magenta { 
            background-color: #D8BFD8 !important; 
            color: #000000 !important;
        }

        .tajwid-cyan { 
            background-color: #20B2AA !important; 
            color: #000000 !important;
        }

        .tajwid-green { 
            background-color: #98FB98 !important; 
            color: #000000 !important;
        }

        .tajwid-blue { 
            background-color: #87CEEB !important; 
            color: #000000 !important;
        }

        .tajwid-default { 
            background-color: #F0F0F0 !important; 
            color: #000000 !important;
        }

        /* BASE STYLES MINIMALIS - HANYA MEMPENGARUHI WARNA HURUF */
        .hadits-page-isolated [class*="tajwid-"] {
            cursor: help;
            padding: 0 !important;
            margin: 0 !important;
            border-radius: 0 !important;
            display: inline !important;
            font-weight: inherit !important;
            text-decoration: none !important;
            transition: none !important;
            transform: none !important;
            box-shadow: none !important;
            position: static !important;
            z-index: auto !important;
            line-height: inherit !important;
            font-size: inherit !important;
            font-family: inherit !important;
            font-style: inherit !important;
        }

        /* Hover effect sangat minimal */
        .hadits-page-isolated [class*="tajwid-"]:hover {
            outline: 2px solid rgba(255, 255, 0, 0.7) !important;
            outline-offset: 1px !important;
        }

        /* ===== LEGENDA TAJWID ===== */
        .tajwid-legend {
            background: #f8f9fa;
            border: 1px solid #dee2e6;
            border-radius: 8px;
            padding: 15px;
            margin: 20px auto;
            max-width: 1200px;
            display: none;
        }

        .tajwid-legend.show {
            display: block;
        }

        .tajwid-legend h4 {
            text-align: center;
            margin-bottom: 15px;
            color: #2c3e50;
            font-weight: 600;
        }

        .legend-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 10px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            padding: 5px;
            font-size: 12px;
        }

        .legend-color {
            width: 16px;
            height: 16px;
            border-radius: 3px;
            margin-right: 8px;
            flex-shrink: 0;
            border: 1px solid #ccc;
        }

        .legend-text {
            flex: 1;
            line-height: 1.3;
        }

        /* ===== TOGGLE BUTTONS ===== */
        .tajwid-toggle-container {
            text-align: center;
            margin: 20px 0;
        }

        .tajwid-toggle {
            display: inline-block;
            padding: 14px 24px;
            background: #3498db;
            color: white;
            text-decoration: none;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.3s ease;
            margin: 8px 5px;
            border: none;
            cursor: pointer;
            font-size: 15px;
            min-height: 48px;
            min-width: 140px;
        }

        .tajwid-toggle:hover {
            background: #2980b9;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .tajwid-toggle.disabled {
            background: #95a5a6;
            cursor: not-allowed;
        }

        .legend-toggle {
            background: #e74c3c;
        }

        .legend-toggle:hover {
            background: #c0392b;
        }

        .legend-toggle.active {
            background: #27ae60;
        }

        /* ===== FORM STYLING ===== */
        .form-container {
            max-width: 800px;
            margin: 20px auto;
            padding: 0 20px;
        }

        .form-group {
            background-color: #ffffff;
            padding: 25px;
            border-radius: 12px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .form-group legend {
            font-size: 1.4em;
            font-weight: bold;
            color: #2c5aa0;
            margin-bottom: 20px;
            text-align: center;
        }

        .form-group input[type="text"] {
            width: 100%;
            padding: 14px 15px;
            border: 2px solid #e1e5e9;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s ease;
            box-sizing: border-box;
            margin-bottom: 10px;
            min-height: 50px;
        }

        .form-group input[type="text"]:focus {
            border-color: #2c5aa0;
            outline: none;
            box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
        }

        .form-group button {
            background: linear-gradient(135deg, #2c5aa0, #3a7bd5);
            color: white;
            padding: 14px 30px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            transition: all 0.3s ease;
            margin-right: 10px;
            margin-bottom: 10px;
            min-height: 50px;
            min-width: 150px;
        }

        .form-group button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(44, 90, 160, 0.3);
        }

        .form-group button[type="button"] {
            background: linear-gradient(135deg, #6c757d, #868e96);
        }

        /* ===== HADITS CONTAINER ===== */
        .hadits-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 15px;
            box-sizing: border-box;
        }

        .hadits-card {
            background: #ffffff;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 25px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
            border-left: 4px solid #2c5aa0;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            box-sizing: border-box;
            width: 100%;
        }

        .hadits-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.12);
        }

        .hadits-number {
            background: linear-gradient(135deg, #2c5aa0, #3a7bd5);
            color: white;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 15px;
            box-shadow: 0 3px 8px rgba(44, 90, 160, 0.3);
        }

        .hadits-title {
            color: #2c5aa0;
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 15px;
            border-bottom: 2px solid #e8f4f8;
            padding-bottom: 8px;
            line-height: 1.4;
            text-align: center;
        }

        /* ===== TEXT ARABIC MURNI ===== */
        @font-face {
            font-family: 'ArabicFont';
            src: url('https://www.quran.misntv.com/font/lpmq.ttf') format('truetype');
        }

        .arabic-text {
            color: #000000;
            direction: rtl;
            font-size: 28px;
            font-family: 'ArabicFont', 'Traditional Arabic', 'Amiri', 'KFGQPC Uthman Taha Naskh', serif;
            line-height: 2;
            text-align: center;
            padding: 10px;
            font-feature-settings: "calt" 1;
            background: #f8f9fa;
            border-radius: 8px;
            margin-bottom: 15px;
            border-right: 3px solid #2c5aa0;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        /* Override untuk span tajwid di dalam teks Arab */
        .arabic-text [class*="tajwid-"] {
            color: #000000 !important;
            font-family: inherit !important;
            font-size: inherit !important;
            line-height: inherit !important;
            font-weight: inherit !important;
        }

        /* Memastikan background-color tajwid tetap bekerja */
        .arabic-text .tajwid-red { background-color: #FF6B6B !important; }
        .arabic-text .tajwid-magenta { background-color: #D8BFD8 !important; }
        .arabic-text .tajwid-cyan { background-color: #20B2AA !important; }
        .arabic-text .tajwid-green { background-color: #98FB98 !important; }
        .arabic-text .tajwid-blue { background-color: #87CEEB !important; }
        .arabic-text .tajwid-default { background-color: #F0F0F0 !important; }

        .terjemahan-text {
            color: #2d5016;
            font-size: 16px;
            line-height: 1.6;
            padding: 15px;
            background: #f0f8f0;
            border-radius: 8px;
            margin-bottom: 12px;
            border-left: 3px solid #4CAF50;
            word-wrap: break-word;
            text-align: center;
        }

        .hadits-info {
            background: #e8f4f8;
            padding: 12px;
            border-radius: 6px;
            margin-top: 12px;
            font-size: 14px;
            color: #555;
            line-height: 1.5;
            text-align: center;
        }

        .hadits-info strong {
            color: #2c5aa0;
        }

        /* ===== BUTTON CONTAINER - PERBAIKAN UTAMA ===== */
        .button-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 12px;
            padding: 15px 0;
            margin: 0 auto;
            max-width: 100%;
        }

        .button-container button {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 160px;
            height: 52px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: bold;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
            color: #FFFFFF;
            text-transform: uppercase;
            flex: 1 1 auto;
            padding: 0 15px;
            box-sizing: border-box;
        }

        /* Warna untuk setiap jenis tombol */
        .copy-btn { background: linear-gradient(135deg, #0056b3, #0069d9); }
        .wa-btn { background: linear-gradient(135deg, #008c4a, #00a854); }
        .pdf-btn { background: linear-gradient(135deg, #b30000, #cc0000); }
        .txt-btn { background: linear-gradient(135deg, #34495e, #465c73); }
        .rtf-btn { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
        .share-btn { background: linear-gradient(135deg, #FFA500, #FF8C00); }
        .audio-btn { background: linear-gradient(135deg, #9C27B0, #7B1FA2); }

        .button-container button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 12px rgba(0, 0, 0, 0.18);
        }

        .button-container button:active {
            transform: translateY(0);
        }

        .button-container svg {
            width: 18px;
            height: 18px;
            fill: white;
            flex-shrink: 0;
        }

        .button-container .button-text {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ===== PAGINATION ===== */
        .pagination-container {
            text-align: center;
            margin: 30px 0;
            padding: 15px;
            overflow-x: auto;
        }

        .pagination-container nav ul {
            list-style: none;
            padding: 0;
            margin: 0;
            display: inline-flex;
            gap: 5px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .pagination-container nav ul li {
            display: inline;
        }

        .pagination-container nav ul li a,
        .pagination-container nav ul li span {
            display: inline-block;
            padding: 10px 16px;
            margin: 2px;
            border: 2px solid #e1e5e9;
            border-radius: 6px;
            text-decoration: none;
            color: #2c5aa0;
            background-color: white;
            transition: all 0.3s ease;
            font-weight: 600;
            font-size: 14px;
            min-width: 44px;
            min-height: 44px;
            box-sizing: border-box;
            line-height: 1.4;
        }

        .pagination-container nav ul li a:hover {
            background-color: #2c5aa0;
            color: white;
            border-color: #2c5aa0;
        }

        .pagination-container nav ul li .current {
            background-color: #2c5aa0;
            color: white;
            border-color: #2c5aa0;
        }

        /* ===== PERBAIKAN & PENYESUAIAN STYLING ===== */

        /* Highlight untuk hadits yang sedang diputar */
        .hadits-card.highlight {
            background-color: #fff3cd !important;
            border-left: 4px solid #ffc107 !important;
        }

        .hadits-card.highlight .arabic-text {
            background: #fff9e6 !important;
        }

        .hadits-card.highlight .terjemahan-text {
            background: #f8f0e6 !important;
        }

        /* Loading indicator */
        #loading-indicator {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0,0,0,0.9);
            color: white;
            padding: 25px 35px;
            border-radius: 12px;
            z-index: 10000;
            font-size: 16px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            min-width: 200px;
        }

        /* Loading spinner */
        .loading-spinner {
            display: inline-block;
            width: 24px;
            height: 24px;
            border: 3px solid rgba(255,255,255,0.3);
            border-top: 3px solid #ffffff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-right: 12px;
            vertical-align: middle;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Download progress */
        #download-progress {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0,0,0,0.9);
            color: white;
            padding: 30px;
            border-radius: 12px;
            z-index: 10000;
            text-align: center;
            min-width: 280px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        }

        .download-progress .progress {
            width: 100%;
            height: 14px;
            background: #444;
            border-radius: 7px;
            margin: 20px 0;
            overflow: hidden;
        }

        .download-progress .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #007bff, #00c6ff);
            border-radius: 7px;
            transition: width 0.3s ease;
            width: 0%;
        }

        #download-message {
            font-size: 14px;
            margin-top: 10px;
            color: #ccc;
        }

        /* Audio player styling */
        .audio-player {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 12px;
            margin: 20px 0;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            border: 1px solid #e9ecef;
        }

        .audio-player .progress {
            width: 100%;
            height: 10px;
            background: #e9ecef;
            border-radius: 6px;
            margin-bottom: 15px;
            overflow: hidden;
        }

        .audio-player .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #007bff, #00c6ff);
            border-radius: 6px;
            width: 0%;
            transition: width 0.1s ease;
        }

        .btn-custom {
            background: linear-gradient(135deg, #007bff, #0056b3);
            color: white;
            border: none;
            padding: 14px 20px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 14px;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-width: 140px;
            min-height: 50px;
            justify-content: center;
            margin: 5px;
        }

        .btn-custom:hover {
            background: linear-gradient(135deg, #0056b3, #003d82);
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0,0,0,0.15);
        }

        /* ===== RESPONSIVE DESIGN - PERBAIKAN UTAMA ===== */

        /* Tablet */
        @media (max-width: 768px) {
            .hadits-container {
                padding: 10px;
            }
            
            .hadits-card {
                padding: 15px;
            }
            
            .arabic-text {
                font-size: 22px;
                line-height: 1.7;
            }
            
            .terjemahan-text {
                font-size: 15px;
            }
            
            .hadits-title {
                font-size: 18px;
            }
            
            .button-container {
                gap: 10px;
            }
            
            .button-container button {
                min-width: calc(50% - 10px);
                font-size: 13px;
                height: 48px;
                padding: 0 12px;
            }
            
            .form-group {
                padding: 20px;
            }
            
            .tajwid-toggle {
                min-width: 130px;
                padding: 12px 20px;
                font-size: 14px;
            }
        }

        /* Mobile - Landscape */
        @media (max-width: 768px) and (orientation: landscape) {
            .button-container button {
                min-width: calc(33.333% - 10px);
                font-size: 12px;
                height: 44px;
            }
            
            .arabic-text {
                font-size: 20px;
            }
        }

        /* Mobile - Portrait */
        @media (max-width: 480px) {
            .arabic-text {
                font-size: 20px;
                line-height: 1.6;
            }
            
            .terjemahan-text {
                font-size: 14px;
            }
            
            .button-container {
                flex-direction: row;
                gap: 8px;
            }
            
            .button-container button {
                min-width: calc(50% - 8px);
                max-width: calc(50% - 8px);
                height: 46px;
                font-size: 12px;
            }
            
            .button-container svg {
                width: 16px;
                height: 16px;
            }
            
            .form-group {
                padding: 15px;
            }
            
            .tajwid-toggle {
                padding: 10px 15px;
                font-size: 13px;
                min-width: 120px;
                min-height: 44px;
            }
            
            .legend-grid {
                grid-template-columns: 1fr;
            }
            
            .pagination-container nav ul li a,
            .pagination-container nav ul li span {
                min-width: 40px;
                min-height: 40px;
                padding: 8px 12px;
                font-size: 13px;
            }
        }

        /* Mobile sangat kecil */
        @media (max-width: 360px) {
            .button-container {
                flex-direction: column;
            }
            
            .button-container button {
                min-width: 100%;
                max-width: 100%;
            }
            
            .tajwid-toggle {
                min-width: 100%;
                margin: 5px 0;
            }
        }

        /* Print Styles */
        @media print {
            .hadits-card {
                box-shadow: none;
                border: 1px solid #ddd;
                page-break-inside: avoid;
            }
            
            .button-container,
            .tajwid-toggle-container,
            .form-container,
            .audio-player {
                display: none !important;
            }
            
            .arabic-text [class*="tajwid-"] {
                background-color: transparent !important;
                color: #000000 !important;
            }
        }