﻿/* EDITÖR KAPSAYICI */
.editor-wrapper {
    /*margin: 20px 0;*/
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* ARAÇ ÇUBUĞU */
.editor-toolbar {
    display: none;
    flex-wrap: wrap;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    gap: 6px;
}

.editor-wrapper.active .editor-toolbar {
    display: flex;
}

.toolbar-group {
    display: flex;
    align-items: center;
    border-right: 1px solid #e0e0e0;
    padding-right: 10px;
    margin-right: 10px;
    gap: 4px;
}

    .toolbar-group:last-child {
        border-right: none;
        margin-right: 0;
        padding-right: 0;
    }

.toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

    .toolbar-btn:hover {
        background-color: #e9ecef;
        border-color: #dee2e6;
    }

    .toolbar-btn.active {
        background-color: #e2e6ea;
        border-color: #d6d8db;
    }

    .toolbar-btn i {
        font-size: 16px;
    }

.toolbar-select {
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    font-size: 14px;
    cursor: pointer;
    min-width: 100px;
}

    .toolbar-select:hover {
        border-color: #adb5bd;
    }

.color-picker-container {
    position: relative;
    display: inline-block;
}

.color-picker {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

/* EDITÖR İÇERİK ALANI */
.editor-content {
    /*padding: 10px;*/
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
    outline: none;
    /*line-height: 1.6;*/
    overflow-y: auto;
    cursor: text;
    font-family: 'Poppins', sans-serif;
    border-radius: 8px;
}

.editor-wrapper.active .editor-content {
    border-radius: 0 0 8px 8px;
}

    /* EDITÖR İÇERİK ALANI - Font boyutu ayarları */
    .editor-content.font32px {
        font-size: 32px !important;
    }

    /* Placeholder için özel stil */
    .editor-content:empty:before,
    .editor-content:has(> br:only-child):before,
    .editor-content:has(> p:only-child > br:only-child):before {
        content: attr(placeholder);
        color: #6c757d;
        opacity: 0.6;
        display: block; /* Blok olarak göster */
    }

    /* Font32px durumu için placeholder */
    .editor-content.font32px:empty:before,
    .editor-content.font32px:has(> br:only-child):before,
    .editor-content.font32px:has(> p:only-child > br:only-child):before {
        font-size: 32px;
    }

    .editor-content img {
        max-width: 100%;
        height: auto;
        cursor: pointer;
        transition: all 0.2s;
    }

        .editor-content img:hover {
            outline: 2px solid #0d6efd;
        }

    .editor-content blockquote {
        border-left: 4px solid #0d6efd;
        padding-left: 16px;
        margin-left: 0;
        color: #555;
        font-style: italic;
    }

    .editor-content table {
        border-collapse: collapse;
        width: 100%;
        margin: 12px 0;
    }

    .editor-content table,
    .editor-content th,
    .editor-content td {
        border: 1px solid #ddd;
    }

    .editor-content th,
    .editor-content td {
        padding: 10px;
        text-align: left;
    }

/* RESİM BOYUTLANDIRMA */
.image-resize-container {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1001;
    display: none;
}

    .image-resize-container.active {
        display: block;
    }

.image-resize-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-resize-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .image-resize-row label {
        min-width: 60px;
        font-size: 14px;
    }

    .image-resize-row input {
        width: 70px;
        padding: 4px;
        border: 1px solid #ddd;
        border-radius: 3px;
    }

.image-resize-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* MODAL STİLLERİ */
.editor-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.editor-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

    .editor-modal-header h5 {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
    }

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0 8px;
    line-height: 1;
}

    .close-btn:hover {
        color: #333;
    }

.editor-modal-body {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

    .form-row .form-group {
        flex: 1;
    }

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

    .form-input:focus {
        outline: none;
        border-color: #80bdff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.editor-check {
    display: flex;
    align-items: center;
    margin-top: 16px;
}

.editor-check-input {
    margin-right: 10px;
}

.editor-check-label {
    font-size: 14px;
    color: #495057;
}

.code-area {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    line-height: 1.5;
}

.editor-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.editor-modal-btn {
    padding: 10px 18px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

    .editor-modal-btn.primary {
        background-color: #0d6efd;
        color: white;
        border-color: #0d6efd;
    }

        .editor-modal-btn.primary:hover {
            background-color: #0b5ed7;
            border-color: #0a58ca;
        }

    .editor-modal-btn.danger {
        background-color: #dc3545;
        color: white;
        border-color: #dc3545;
    }

        .editor-modal-btn.danger:hover {
            background-color: #bb2d3b;
            border-color: #b02a37;
        }

    .editor-modal-btn.secondary {
        background-color: #6c757d;
        color: white;
        border-color: #6c757d;
    }

        .editor-modal-btn.secondary:hover {
            background-color: #5c636a;
            border-color: #565e64;
        }

/* DARK MODE */
[data-bs-theme="dark"] {
    background-color: #121212;
    color: #e0e0e0;
}

    [data-bs-theme="dark"] .editor-wrapper {
        background-color: #1e1e1e;
        border-color: #333;
    }

    [data-bs-theme="dark"] .editor-toolbar {
        background-color: #2a2a2a;
        border-bottom-color: #444;
    }

    [data-bs-theme="dark"] .toolbar-btn {
        color: #ccc;
    }

        [data-bs-theme="dark"] .toolbar-btn.active {
            background-color: #000000;
        }

        [data-bs-theme="dark"] .toolbar-btn:hover {
            background-color: #333;
            border-color: #555;
        }

    [data-bs-theme="dark"] .editor-content {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

        [data-bs-theme="dark"] .editor-content img:hover {
            outline-color: #90caf9;
        }

        [data-bs-theme="dark"] .editor-content blockquote {
            border-left-color: #90caf9;
            color: #aaa;
        }

    [data-bs-theme="dark"] .editor-modal-content {
        background-color: #2e2e2e;
        color: #ddd;
    }

    [data-bs-theme="dark"] .editor-modal-header {
        border-bottom-color: #555;
    }

    [data-bs-theme="dark"] .editor-modal-footer {
        border-top-color: #555;
    }

    [data-bs-theme="dark"] .form-input,
    [data-bs-theme="dark"] .code-area {
        background-color: #1e1e1e;
        border-color: #555;
        color: #eee;
    }

        [data-bs-theme="dark"] .form-input:focus,
        [data-bs-theme="dark"] .code-area:focus {
            border-color: #90caf9;
            box-shadow: 0 0 0 0.2rem rgba(144, 202, 249, 0.25);
        }

/* RESPONSIVE */
@media (max-width: 768px) {
    .editor-toolbar {
        gap: 4px;
        padding: 8px;
    }

    .toolbar-group {
        padding-right: 6px;
        margin-right: 6px;
    }

    .toolbar-btn {
        padding: 6px 8px;
    }

    .toolbar-select {
        min-width: 80px;
        padding: 5px;
    }

    .editor-modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 18px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }
}
