/* =========================================
   SIYAH SAYFALAR — LITERARY QUOTE CARD
   PREMIUM BLACK / GOLD
========================================= */

.quote-card-trigger-wrapper {
    margin: 18px 0 25px;
}

.quote-card-trigger {
    width: 100%;
    min-height: 76px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    border: 1px solid rgba(198, 161, 91, .25);
    border-radius: 12px;
    background: linear-gradient(120deg, #171512, #0b0b0b);
    color: #d5b77b;
    cursor: pointer;
    transition: .3s ease;
}

.quote-card-trigger:hover {
    border-color: rgba(213, 183, 123, .65);
    background: linear-gradient(120deg, #211d16, #101010);
    transform: translateY(-2px);
}

.quote-trigger-icon {
    width: 43px;
    height: 43px;
    min-width: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(213,183,123,.3);
    border-radius: 10px;
    background: rgba(213,183,123,.07);
}

.quote-trigger-icon svg {
    width: 23px;
    height: 23px;
}

.quote-trigger-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.quote-trigger-text strong {
    font-size: 14px;
    color: #e4c58a;
    letter-spacing: .5px;
}

.quote-trigger-text small {
    font-size: 11px;
    color: #999;
}

.quote-trigger-arrow {
    margin-left: auto;
    font-size: 23px;
    color: #c6a15b;
}


/* =========================================
   MODAL
========================================= */

.quote-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quote-modal.active {
    display: flex;
}

.quote-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.quote-modal-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 94vh;
    overflow-y: auto;
    border: 1px solid rgba(198,161,91,.25);
    border-radius: 16px;
    background: #0e0e0e;
    box-shadow: 0 25px 90px rgba(0,0,0,.7);
    animation: quoteModalIn .3s ease;
}

@keyframes quoteModalIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* HEADER */

.quote-modal-header {
    padding: 23px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.quote-modal-eyebrow {
    font-size: 9px;
    letter-spacing: 3px;
    color: #b99a5c;
}

.quote-modal-header h3 {
    margin: 7px 0 4px;
    font-family: Georgia, serif;
    font-size: 23px;
    color: #e6d1a8;
}

.quote-modal-header p {
    margin: 0;
    font-size: 11px;
    color: #888;
}

.quote-modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50%;
    background: #171717;
    color: #ccc;
    font-size: 25px;
    cursor: pointer;
}

.quote-modal-close:hover {
    color: #d5b77b;
    border-color: #b99a5c;
}


/* BODY */

.quote-modal-body {
    padding: 25px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: center;
}


/* PREVIEW */

.quote-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 5px;
    background: #090909;
    box-shadow: 0 15px 40px rgba(0,0,0,.5);
}

#quoteCanvas {
    display: block;
    width: 100%;
    height: auto;
}

.quote-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.75);
    color: #d5b77b;
    font-size: 13px;
}

.quote-loading.active {
    display: flex;
}


/* EDITOR */

.quote-editor {
    width: 100%;
}

.quote-editor-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 10px;
    letter-spacing: 2px;
    color: #c5a56c;
}

.quote-editor-line {
    height: 1px;
    flex: 1;
    background: rgba(198,161,91,.2);
}

#quoteText {
    width: 100%;
    min-height: 130px;
    padding: 14px;
    resize: vertical;
    border: 1px solid rgba(198,161,91,.2);
    border-radius: 8px;
    outline: none;
    background: #171717;
    color: #e7d6b4;
    font-family: Georgia, serif;
    font-size: 15px;
    line-height: 1.7;
}

#quoteText:focus {
    border-color: #a98a50;
}

.quote-character-count {
    margin-top: 7px;
    text-align: right;
    color: #777;
    font-size: 10px;
}


/* CHANGE BUTTON */

.quote-change-btn {
    width: 100%;
    min-height: 43px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid rgba(198,161,91,.35);
    border-radius: 7px;
    background: rgba(198,161,91,.08);
    color: #d5b77b;
    font-size: 12px;
    cursor: pointer;
    transition: .25s;
}

.quote-change-btn:hover {
    background: rgba(198,161,91,.17);
    border-color: #c6a15b;
}

.quote-change-btn svg {
    width: 17px;
    height: 17px;
}


/* ACTIONS */

.quote-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 13px;
}

.quote-modal-actions button {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 7px;
    font-size: 11px;
    cursor: pointer;
    transition: .25s;
}

.quote-modal-actions svg {
    width: 17px;
    height: 17px;
}

.quote-download-btn {
    border: 1px solid #b99a5c;
    background: linear-gradient(135deg, #b99a5c, #806331);
    color: #100e0a;
    font-weight: 700;
}

.quote-download-btn:hover {
    filter: brightness(1.15);
}

.quote-share-btn {
    border: 1px solid rgba(255,255,255,.15);
    background: #1b1b1b;
    color: #ddd;
}

.quote-share-btn:hover {
    border-color: #b99a5c;
    color: #d5b77b;
}

.quote-status {
    min-height: 20px;
    margin-top: 12px;
    color: #c5a56c;
    font-size: 11px;
    text-align: center;
}

.quote-modal-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    margin-top: 12px;
    border-top: 1px solid rgba(255,255,255,.07);
    color: #666;
    font-size: 9px;
    letter-spacing: 1px;
}


/* =========================================
   MOBILE
========================================= */

@media(max-width:767px) {

    .quote-modal {
        padding: 8px;
    }

    .quote-modal-container {
        max-height: 96vh;
        border-radius: 12px;
    }

    .quote-modal-header {
        padding: 17px;
    }

    .quote-modal-header h3 {
        font-size: 19px;
    }

    .quote-modal-body {
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .quote-preview-wrapper {
        max-width: 340px;
    }

    .quote-editor {
        max-width: 500px;
        margin: 0 auto;
    }

    #quoteText {
        min-height: 90px;
    }

    .quote-modal-footer {
        margin-bottom: 5px;
    }

}

/* =========================================
   MOBILE MODAL CLOSE FIX
========================================= */

@media (max-width: 767px) {

    .quote-modal {
        padding: 8px;
        padding-top: max(8px, env(safe-area-inset-top));
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        align-items: flex-start;
    }

    .quote-modal-container {
        position: relative;
        margin-top: 5px;
        max-height: calc(100dvh - 16px);
        max-height: calc(
            100dvh -
            env(safe-area-inset-top) -
            env(safe-area-inset-bottom) -
            16px
        );
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .quote-modal-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #0e0e0e;
        padding: 15px 17px;
    }

    .quote-modal-close {
        position: sticky;
        top: 5px;
        flex-shrink: 0;
        z-index: 11;
        width: 42px;
        height: 42px;
    }

}

/* =========================================
   SIYAH SAYFALAR — MOBILE MODAL CLOSE FIX
   ========================================= */

@media (max-width: 767px) {

    .quote-modal {
        align-items: flex-start;
        justify-content: center;

        padding: max(8px, env(safe-area-inset-top))
                 8px
                 max(8px, env(safe-area-inset-bottom));
    }

    .quote-modal-container {
        position: relative;
        width: 100%;

        max-height: calc(100dvh - 16px);
        overflow-y: auto;

        margin: 0;
        overscroll-behavior: contain;
    }

    .quote-modal-header {
        position: sticky;
        top: 0;
        z-index: 20;

        background: #0e0e0e;

        padding: 17px 60px 17px 17px;
    }

    /* Kapatma düğmesi */
    .quote-modal-close {
        position: absolute !important;

        top: 12px !important;
        right: 12px !important;

        z-index: 30 !important;

        display: flex;
        align-items: center;
        justify-content: center;

        width: 42px;
        height: 42px;

        margin: 0;
        padding: 0;

        flex-shrink: 0;
        cursor: pointer;

        background: rgba(255,255,255,0.07);
        border: 1px solid rgba(211,178,112,0.35);
        border-radius: 50%;

        color: #d6b77d;
        font-size: 28px;
        line-height: 1;

        transform: none !important;
    }

    .quote-modal-close:hover {
        background: rgba(211,178,112,0.15);
        color: #fff;
    }

}

/* =========================================
   SIYAH SAYFALAR — MOBILE CLOSE BUTTON FIX
========================================= */

@media (max-width: 767px) {

    .quote-modal-container {
        margin-top: 15px !important;
    }

    .quote-modal-header {
        padding-top: 20px !important;
        min-height: 85px;
    }

    .quote-modal-close {
        top: 48px !important;
        right: 12px !important;
        z-index: 999 !important;
    }

}