/* ==========================================
   2. NAVIGATION BAR
   ========================================== */
.rg-page .navbar { display: none; }

.rg-page .navbar-content { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 12px 20px;
    display: flex; 
    justify-content: space-between;
    align-items: center;
}

.rg-page .navbar-content.center {
    justify-content: center;
}

.rg-page .logo { 
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.3px;
}

.rg-page .logo i { 
    font-size: 28px;
    color: var(--primary-color);
}

.rg-page .back-btn { 
    background: var(--primary-color);
    color: white; 
    padding: 10px 20px; 
    text-decoration: none; 
    border-radius: 6px; 
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.rg-page .back-btn:hover { 
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

/* ==========================================
   3. CONTAINERS
   ========================================== */
.rg-page .container { 
    max-width: 1200px; 
    margin: 15px auto; 
    padding: 0 20px; 
}

.rg-page .main-container { 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* ==========================================
   4. DATE PICKER
   ========================================== */
.rg-page .date-picker-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto 20px;
    background: var(--bg-primary);
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.rg-page .date-picker-container input[type="date"] {
    flex: 1;
    padding: 0 16px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.2s;
    background: var(--bg-primary);
    box-sizing: border-box;
    height: 44px;
    line-height: 44px;
    vertical-align: top;
}

.rg-page .date-picker-container input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.rg-page .date-picker-container .search-btn {
    padding: 0 32px;
    margin: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    height: 44px;
    line-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.rg-page .date-picker-container .search-btn:hover {
    background: var(--primary-hover);
}

/* Generic action button to reuse outside date picker */
.rg-page .search-btn {
    padding: 12px 32px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.rg-page .search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* ==========================================
   5. CARDS
   ========================================== */
.rg-page .card { 
    background: var(--bg-primary); 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    box-shadow: var(--shadow-md); 
    overflow: hidden; 
    margin-bottom: 30px; 
}

.rg-page .card-header { 
    background: var(--bg-secondary);
    color: var(--text-color); 
    padding: 12px 16px; 
    border-bottom: 2px solid var(--primary-color);
}

.rg-page .card-header h2 { 
    font-size: 18px; 
    margin-bottom: 4px;
    font-weight: 700;
    color: var(--primary-color);
}

.rg-page .card-header p {
    color: var(--text-light);
    font-weight: 600;
}

.rg-page .card-body { 
    padding: 16px; 
}

/* Warning section inside card-body */
.rg-page .rg-warning {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.08); /* subtle amber */
    color: var(--text-color);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-left: 4px solid #f59e0b; /* amber accent */
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.6;
}

.rg-page .rg-warning .rg-warning-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #b45309; /* darker amber */
    margin-bottom: 6px;
}

.rg-page .rg-warning .rg-warning-title i {
    color: #f59e0b;
}

.rg-page .rg-warning .rg-warning-text {
    font-size: 13px;
}

/* ==========================================
   6. LOADING & ERROR STATES
   ========================================== */
.rg-page .loading { 
    text-align: center; 
    padding: 60px 20px; 
    color: var(--text-color);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 20px;
}

.rg-page .loading .spinner { 
    border: 3px solid #f0f2f5; 
    border-top: 3px solid var(--primary-color); 
    border-radius: 50%; 
    width: 50px; 
    height: 50px; 
    animation: spin 1s linear infinite; 
    margin: 0 auto 20px; 
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.rg-page .error { 
    background: rgba(239, 68, 68, 0.1); 
    color: #dc3545; 
    padding: 18px; 
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 3px solid #dc3545;
    border-radius: 6px; 
}

/* ==========================================
   7. SECTIONS
   ========================================== */
.rg-page .section { 
    margin-bottom: 12px; 
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
}

.rg-page .section-title { 
    font-size: 15px; 
    color: var(--primary-color);
    font-weight: 600; 
    margin-bottom: 8px; 
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    letter-spacing: 0.3px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
}

/* ==========================================
   8. DOCUMENT ITEMS
   ========================================== */
.rg-page .doc-item { 
    padding: 8px 12px;
    margin: 6px 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-bottom: 3px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.rg-page .doc-item.htm {
    border-bottom-color: #4CAF50;
}

.rg-page .doc-item.pdf {
    border-bottom-color: #FF9800;
}

/* Hover Effects */
.rg-page .doc-item:hover {
    /* Arka planı değiştirme: beyazlaşma etkisini kaldır */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-bottom-width: 4px;
}


.rg-page .doc-link { 
    color: var(--text-color); 
    text-decoration: none; 
    display: block;
}

.rg-page .doc-link:hover { 
    color: var(--primary-color); 
}

.rg-page .doc-text { 
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    flex: 1;
}

/* ==========================================
   8.1 INLINE EMBEDDED DOCS (auto-loaded fragments)
   ========================================== */
.rg-page .embedded-doc {
    margin: 6px 12px 4px 12px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid #4CAF50; /* match .htm accent */
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 14px;
}

.rg-page .embedded-doc h1,
.rg-page .embedded-doc h2,
.rg-page .embedded-doc h3,
.rg-page .embedded-doc h4 {
    color: var(--text-color);
    margin: 10px 0 6px 0;
    font-weight: 600;
}

.rg-page .embedded-doc h1 {
    font-size: 18px;
}

.rg-page .embedded-doc h2 {
    font-size: 16px;
}

.rg-page .embedded-doc h3 {
    font-size: 15px;
}

.rg-page .embedded-doc h4 {
    font-size: 14px;
}

.rg-page .embedded-doc p {
    margin: 6px 0;
    line-height: 1.5;
}

.rg-page .embedded-doc ul,
.rg-page .embedded-doc ol {
    margin: 6px 0;
    padding-left: 24px;
}

.rg-page .embedded-doc li {
    margin: 4px 0;
    line-height: 1.5;
}

.rg-page .embedded-doc br {
    margin: 2px 0;
}

.rg-page .embedded-doc a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Loading state for inline fragment fetch */
.rg-page .doc-item.loading-fragment {
    opacity: 0.75;
}

.rg-page .doc-item.loading-fragment::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================
   9. DOCUMENT CONTENT (for show-document.php)
   ========================================== */
.rg-page .content { 
    background: white; 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    box-shadow: var(--shadow-md); 
    overflow: hidden; 
}

/* Content Search Container */
.rg-page .content-search-container {
    margin-bottom: 20px;
    padding: 0;
}

.rg-page .search-box-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.rg-page .content-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    background: var(--bg-primary);
    transition: all 0.2s;
    box-sizing: border-box;
}

.rg-page .content-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.rg-page .content-search-input::placeholder {
    color: #9ca3af;
}

.rg-page .content-search-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.rg-page .content-search-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.rg-page .content-search-btn:active {
    transform: translateY(1px);
}

.rg-page .content-search-btn i {
    font-size: 14px;
}

/* Search Highlight */
.rg-page .search-highlight {
    background-color: #fef08a; /* Sarı highlight */
    color: #1f2937;
    padding: 2px 0;
    font-weight: 600;
    border-radius: 2px;
}

.rg-page .doc-content { 
    padding: 35px; 
    line-height: 1.8; 
    font-size: 15px; 
    color: var(--text-color); 
    font-weight: 400; 
    background: var(--bg-primary);
}

.rg-page .doc-content p { 
    margin: 16px 0; 
    text-align: left; 
    line-height: 1.8; 
    font-weight: 400; 
}

.rg-page .doc-content strong, .rg-page .doc-content b { 
    font-weight: 600; 
    color: var(--dark-color); 
}

.rg-page .doc-content a { 
    color: var(--primary-color); 
    text-decoration: underline; 
    font-weight: 500; 
    transition: all 0.2s; 
}

.rg-page .doc-content a:hover { 
    color: var(--primary-hover); 
}

.rg-page .doc-content h1, .rg-page .doc-content h2, .rg-page .doc-content h3, .rg-page .doc-content h4 { 
    color: #1f2937; 
    margin: 28px 0 18px 0; 
    font-weight: 600; 
    line-height: 1.4; 
}

.rg-page .doc-content h1 { 
    font-size: 24px; 
    padding: 16px; 
    background: var(--primary-color); 
    color: white; 
    border-radius: 6px; 
    margin: 20px 0; 
    font-weight: 600; 
    text-align: center;
}

.rg-page .doc-content h2 { 
    font-size: 20px; 
    padding: 12px 0; 
    border-bottom: 2px solid var(--primary-color); 
    font-weight: 600; 
}

.rg-page .doc-content h3 { 
    font-size: 18px; 
    padding: 10px 0; 
    border-bottom: 1px solid #e5e7eb; 
    font-weight: 600; 
}

.rg-page .doc-content h4 { 
    font-size: 16px; 
    color: #6b7280; 
    padding: 8px 0; 
    font-weight: 600; 
}

.rg-page .doc-content ul, .rg-page .doc-content ol { 
    margin: 20px 0; 
    padding-left: 30px; 
    line-height: 2; 
}

.rg-page .doc-content li { 
    margin: 12px 0; 
    padding-left: 10px; 
}

.rg-page .doc-content em, .rg-page .doc-content i { 
    font-style: italic; 
    color: #7f8c8d; 
}

.rg-page .doc-content u { 
    text-decoration: underline; 
    text-decoration-color: #3498db; 
    text-decoration-thickness: 2px; 
}

.rg-page .doc-content br { 
    margin: 8px 0; 
    display: block; 
    content: " "; 
}

/* ==========================================
   10. RESMI-GAZETE-CLEAN.PHP SPECIFIC STYLES
   ========================================== */
.rg-page .header { 
    background: white; 
    padding: 25px; 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    margin-bottom: 20px; 
    box-shadow: var(--shadow-md); 
}

.rg-page .header h1 { 
    color: var(--primary-color); 
    margin-bottom: 10px; 
}

.rg-page .header p { 
    color: #6b7280; 
}

.rg-page .doc-card { 
    background: white; 
    margin-bottom: 20px; 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: var(--shadow-md); 
}

.rg-page .doc-header { 
    padding: 18px; 
    background: var(--primary-color);
    color: white; 
}

.rg-page .doc-header h2 { 
    font-size: 17px; 
    margin-bottom: 8px;
    font-weight: 600;
}

.rg-page .doc-header a { 
    color: white; 
    text-decoration: underline; 
}

.rg-page .doc-status { 
    padding: 12px 18px; 
    background: var(--bg-secondary); 
    border-bottom: 1px solid var(--border-color); 
}

.rg-page .badge { 
    display: inline-block; 
    padding: 4px 12px; 
    border-radius: 4px; 
    font-size: 11px; 
    font-weight: 600; 
    margin-right: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rg-page .badge-htm { 
    background: #4CAF50; 
    color: white; 
}

.rg-page .badge-pdf { 
    background: #FF9800; 
    color: white; 
}

.rg-page .badge-skip { 
    background: #9E9E9E; 
    color: white; 
}

.rg-page .status-success { 
    color: #4CAF50; 
    font-weight: bold; 
}

.rg-page .status-error { 
    color: #f44336; 
    font-weight: bold; 
}

.rg-page .status-info { 
    color: #2196F3; 
    font-weight: bold; 
}

.rg-page .link-button { 
    display: inline-block; 
    padding: 10px 22px; 
    background: #4CAF50; 
    color: white; 
    text-decoration: none; 
    border-radius: 6px; 
    font-weight: 600; 
    margin: 10px 0; 
    transition: all 0.2s; 
}

.rg-page .link-button:hover { 
    background: #45a049; 
    box-shadow: var(--shadow-md); 
}

.rg-page .summary { 
    background: white; 
    padding: 20px; 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    margin-bottom: 20px; 
    box-shadow: var(--shadow-md); 
}

.rg-page .summary-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 15px; 
    margin-top: 15px; 
}

.rg-page .summary-item { 
    text-align: center; 
    padding: 15px; 
    background: var(--bg-secondary); 
    border: 1px solid var(--border-color);
    border-radius: 6px; 
}

.rg-page .summary-item strong { 
    display: block; 
    font-size: 26px; 
    color: var(--primary-color); 
    margin-bottom: 5px;
    font-weight: 600;
}

.rg-page .loader { 
    border: 3px solid #f0f2f5; 
    border-top: 3px solid var(--primary-color); 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
    margin: 20px auto; 
}

/* ==========================================
   11. RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .rg-page .navbar-content { 
        padding: 15px 20px; 
    }
    
    .rg-page .container { 
        padding: 0 20px; 
    }
    
    .rg-page .logo { 
        font-size: 24px; 
    }
    
    .rg-page .logo i { 
        font-size: 30px; 
    }
    
    .rg-page .date-picker-container {
        flex-direction: column;
        padding: 15px;
        margin-bottom: 30px;
    }
    
    .rg-page .date-picker-container input[type="date"],
    .rg-page .date-picker-container .search-btn {
        width: 100%;
    }
    
    .rg-page .card-body { 
        padding: 20px; 
    }
    
    .rg-page .section { 
        grid-template-columns: 1fr; 
        gap: 10px;
    }
    .rg-page .doc-item { 
        padding: 12px 15px; 
    }
    
    .rg-page .doc-text { 
        font-size: 15px; 
        font-weight: 500; 
    }
    
    .rg-page .doc-content { 
        padding: 20px; 
        font-size: 15px; 
        font-weight: 500; 
    }
    
    .rg-page .doc-content p { 
        font-weight: 500; 
    }
    
    .rg-page .doc-content h1 { 
        font-size: 22px; 
        padding: 15px; 
    }
    
    .rg-page .doc-content h2 { 
        font-size: 19px; 
    }
    
    .rg-page .doc-content h3 {
        font-size: 17px;
    }
    
    /* Content Search Responsive */
    .rg-page .search-box-wrapper {
        flex-direction: column;
    }
    
    .rg-page .content-search-input,
    .rg-page .content-search-btn {
        width: 100%;
    }
    
    .rg-page .content-search-btn {
        padding: 12px 20px;
    }
}

/* Dark mode adjustments: rely on global CSS variables, add a few explicit tweaks */
body.dark-mode .rg-page .section-title { color: #fff; }
body.dark-mode .rg-page .error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239,68,68,0.4); }

/* Dark mode tweaks for embedded docs and loading visuals */
body.dark-mode .rg-page .embedded-doc {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .rg-page .doc-item.loading-fragment::after {
    border-color: rgba(255,255,255,0.12);
    border-top-color: var(--primary-color);
}

/* Dark mode for search highlight */
body.dark-mode .rg-page .search-highlight {
    background-color: #fbbf24; /* Daha koyu sarı dark mode için */
    color: #1f2937;
}

