/* ==========================================================================
   TERFIUI v5 — Akıllı Notlarım (notes) Sayfa Stili
   ========================================================================== */

/* Page Body Spacing & Structure (Kural 20 Uyumlu - quick_facts.php / category_documents.php 1:1 Birebir Aynı) */
.gd-notes-body {
    margin: 0 !important;
    padding: 8px !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.gd-notes-lock-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px !important;
    width: 100%;
}

/* Premium Lock Overlay for logged-in free users & guests (category_documents.php 1:1 Birebir Aynı Yapı) */
.gd-notes-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    border-radius: 16px;
}

.gd-notes-lock-box {
    width: 100%;
    max-width: 550px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    position: relative;
}

.gd-notes-body .gd-page-header {
    margin-bottom: 0 !important;
}

/* Kompakt Akıllı Notlarım Hero Kartı (Kompakt İnce Görünüm) */
.gd-notes-hero-compact {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 14px 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}

.gd-notes-hero-compact .gd-page-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fef3c7;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gd-notes-hero-compact .gd-page-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}

.gd-notes-hero-compact .gd-page-subtitle {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.gd-notes-body .gd-mev-controls {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.gd-notes-body .gd-page-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fef3c7;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.12);
}

.gd-notes-body .gd-mev-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

@media (max-width: 992px) {
    .gd-notes-body .gd-mev-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .gd-notes-body .gd-mev-grid {
        grid-template-columns: 1fr;
    }
}

.gd-notes-body .gd-mev-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: all 0.2s ease;
    overflow: hidden;
}

.gd-notes-body .gd-mev-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    border-color: #fde68a;
}

.gd-notes-body .gd-mev-card-header {
    background: #fef9c3;
    border-bottom: 1px solid #fef08a;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.gd-notes-body .gd-mev-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #854d0e;
    line-height: 1;
}

.gd-notes-body .gd-mev-card-body {
    padding: 18px 18px 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.gd-notes-body .gd-mev-card-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gd-notes-body .gd-mev-card-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gd-notes-body .gd-mev-card-footer {
    padding: 14px 18px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}

.gd-notes-body .gd-mev-footer-info {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.gd-notes-body .gd-mev-action-link {
    font-size: 13px;
    font-weight: 800;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.gd-notes-body .gd-mev-card:hover .gd-mev-action-link {
    color: #1d4ed8;
}

/* ── Hero Banner (Kategori Listesi Görünümü) ── */
.gd-notes-hero {
    background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #d97706 100%) !important;
    border-radius: 14px !important;
    padding: 24px 28px !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.2);
    border: none !important;
}

.gd-notes-hero::after {
    content: '';
    position: absolute;
    right: -5%;
    bottom: -30%;
    width: 220px;
    height: 220px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.gd-notes-hero-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    z-index: 1;
}

.gd-notes-hero-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff !important;
}

.gd-notes-hero-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    margin: 0 0 6px !important;
    color: #ffffff !important;
    line-height: 1.2;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.gd-notes-hero-desc {
    font-size: 14px !important;
    color: #ffffff !important;
    opacity: 1 !important;
    margin: 0 !important;
    line-height: 1.5;
    max-width: 650px;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ── Arama Çubuğu ── */
.gd-notes-search-box {
    position: relative;
    width: 100%;
    margin-top: 4px;
}

.gd-notes-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.gd-notes-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.gd-notes-search-input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

/* ── Kategori Izgarası (Liste Görünümü) ── */
.gd-notes-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.gd-notes-cat-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.gd-notes-cat-card:hover {
    border-color: #fde68a;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(217, 119, 6, 0.12);
}

.gd-notes-cat-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.gd-notes-cat-card-icon {
    width: 44px;
    height: 44px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.gd-notes-cat-card:hover .gd-notes-cat-card-icon {
    background: #d97706;
    color: #ffffff;
}

.gd-notes-cat-card-info {
    flex: 1;
    min-width: 0;
}

.gd-notes-cat-card-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gd-notes-cat-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gd-notes-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.gd-notes-tag-amber {
    background: #fef3c7;
    color: #b45309;
}

.gd-notes-tag-blue {
    background: #eff6ff;
    color: #2563eb;
}

.gd-notes-cat-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #d97706;
    transition: color 0.2s ease;
}

.gd-notes-cat-card:hover .gd-notes-cat-card-action {
    color: #b45309;
}

.gd-notes-cat-action-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Boş Durum ── */
.gd-notes-empty {
    text-align: center;
    padding: 60px 24px;
    background: #ffffff;
    border-radius: 14px;
    border: 2px dashed #e2e8f0;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gd-notes-empty-icon {
    width: 60px;
    height: 60px;
    background: #fef3c7;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #d97706;
}

.gd-notes-empty-title {
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 6px;
}

.gd-notes-empty-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px;
    max-width: 400px;
    line-height: 1.5;
}

/* ── Okuma / Detay Görünümü Üst Çubuk ── */
.gd-notes-toolbar {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gd-notes-toolbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gd-notes-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: color 0.2s;
}

.gd-notes-back-link:hover {
    color: #d97706;
}

.gd-notes-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gd-notes-font-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gd-notes-font-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    color: #475569;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gd-notes-font-btn:hover {
    background: #f8fafc;
    border-color: #d97706;
    color: #b45309;
}

.gd-notes-cat-trigger {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}

.gd-notes-cat-trigger:hover {
    background: #fefce8;
    border-color: #fde68a;
    color: #b45309;
}

.gd-notes-cat-trigger-text {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Hızlı Not Ekleme Kutusu ── */
.gd-notes-quick-add {
    background: #ffffff;
    border: 2px dashed #fde68a;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gd-notes-quick-textarea {
    width: 100%;
    min-height: 80px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: #451a03;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.6;
}

.gd-notes-quick-actions {
    display: flex;
    justify-content: flex-end;
}

/* ── Not Kartları Izgarası ── */
.gd-notes-item-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gd-notes-item-card {
    background: #fffbeb;
    border-radius: 14px;
    border: 1.5px solid #fde68a;
    border-bottom: 3.5px solid #fde68a;
    padding: 16px;
    transition: all 0.2s ease;
    display: flex;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.gd-notes-item-card:hover {
    box-shadow: 0 8px 16px -4px rgba(180, 83, 9, 0.12);
    transform: translateY(-2px);
    border-color: #fcd34d;
}

.gd-notes-item-idx {
    font-size: 20px;
    font-weight: 900;
    color: #d97706;
    opacity: 0.25;
    min-width: 28px;
    border-right: 1.5px solid #fde68a;
    padding-right: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.gd-notes-item-content {
    flex: 1;
    min-width: 0;
}

.gd-notes-item-text {
    font-size: 14px;
    line-height: 1.6;
    color: #451a03;
    white-space: pre-wrap;
    margin-bottom: 12px;
}

.gd-notes-item-meta {
    font-size: 11px;
    color: #92400e;
    border-top: 1px dashed rgba(146, 64, 14, 0.15);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gd-notes-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.gd-notes-item-card:hover .gd-notes-item-actions {
    opacity: 1;
}

.gd-notes-act-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: #ffffff;
    color: #d97706;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gd-notes-act-btn:hover {
    background: #fef3c7;
    color: #b45309;
}

.gd-notes-act-btn.trash {
    color: #ef4444;
}

.gd-notes-act-btn.trash:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Düzenleyici Modu */
.gd-notes-item-editor {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.gd-notes-item-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1.5px solid #fde68a;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: #ffffff;
    box-sizing: border-box;
}

.gd-notes-item-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Kilitli Ön Gösterim (Overlay) ── */
.gd-notes-lock-wrap {
    position: relative;
}

.gd-notes-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 50;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    box-sizing: border-box;
}

.gd-notes-lock-card {
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.98);
    padding: 4px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    margin-top: 20px;
    position: relative;
}

.gd-notes-lock-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #475569;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    transition: all 0.2s;
}

.gd-notes-lock-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── Kategori Seçici Modal ── */
.gd-notes-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.gd-notes-modal {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: hidden;
    animation: notesModalSlideUp 0.25s ease-out;
}

@keyframes notesModalSlideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.gd-notes-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gd-notes-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.gd-notes-modal-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: 0.2s;
}

.gd-notes-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.gd-notes-modal-list {
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gd-notes-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s ease;
    gap: 10px;
}

.gd-notes-modal-item.active {
    background: #d97706;
    color: #ffffff;
    border-color: #b45309;
}

.gd-notes-modal-item:hover:not(.active) {
    background: #fef3c7;
    border-color: #fde68a;
    color: #b45309;
}

.gd-notes-modal-count {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 800;
    white-space: nowrap;
}

.gd-notes-modal-item.active .gd-notes-modal-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ── Silme Onay Modalı ── */
.gd-notes-confirm-modal {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: notesModalSlideUp 0.22s ease-out;
}

.gd-notes-confirm-body {
    padding: 24px 20px 16px;
    text-align: center;
}

.gd-notes-confirm-icon {
    width: 48px;
    height: 48px;
    background: #fee2e2;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: #ef4444;
}

.gd-notes-confirm-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 6px;
}

.gd-notes-confirm-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.gd-notes-confirm-footer {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #f1f5f9;
}

.gd-notes-confirm-footer .gd-btn {
    flex: 1;
    justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .gd-notes-cat-grid,
    .gd-notes-item-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .gd-notes-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .gd-notes-item-actions {
        opacity: 1;
    }

    .gd-notes-toolbar-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .gd-notes-cat-card,
    .gd-notes-item-card {
        padding: 14px;
    }
}
