/* ==========================================================================
   modal.css — Modal, overlay ve toast bildirimleri
   ========================================================================== */

/* --------- Overlay --------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--overlay-color);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: var(--z-modal);
}

.modal-overlay.is-open {
    display: flex;
}

/* --------- Modal kutusu (açık arka plan, koyu yazı) --------- */
.modal {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #f4f5f7;
    color: #2a2f3a;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-modal);
    border: 1px solid #d5d8de;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #dde0e6;
}

.modal__title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2530;
}

.modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    color: #6a7080;
    font-size: 18px;
}

.modal__close:hover {
    background-color: #e6e8ec;
    color: #1f2530;
}

.modal__body {
    padding: 18px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #dde0e6;
}

/* Modal içi açık tema butonları */
.modal .btn {
    color: #fff;
}

.modal .btn--success {
    background-color: var(--green-color);
    border-color: var(--green-color);
    color: #23300f;
}

.modal .btn--danger {
    background-color: var(--red-color);
    border-color: var(--red-color);
    color: #fff;
}

.modal .btn--muted {
    background-color: #e6e8ec;
    border-color: #d3d6dd;
    color: #3a4150;
}
.modal .btn--muted:hover { background-color: #dbdee4; }

/* Hayvan detay modal düzeni */
.animal-detail {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

.animal-detail__media {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: #eceef2;
    border: 1px solid #dde0e6;
    border-radius: var(--radius-md);
}

.animal-detail__media img {
    width: 100%;
    max-width: 200px;
}

.animal-detail__info {
    font-size: 13px;
}

.detail-table {
    width: 100%;
    font-size: 13px;
}

.detail-table th,
.detail-table td {
    padding: 7px 4px;
    text-align: left;
    border-bottom: 1px solid #e3e5ea;
}

.detail-table th {
    color: #5a6170;
    font-weight: 400;
    width: 45%;
}

.detail-table td {
    font-weight: 700;
    color: #232936;
}

.detail-buy {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #dde0e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-buy__total {
    font-size: 15px;
}

.detail-buy__total strong {
    font-size: 20px;
    color: var(--active-color-dark);
}

/* Modal içinde açık tema sayı girişi */
.modal .qty {
    border-color: #c8ccd4;
}
.modal .qty button {
    background-color: #e6e8ec;
    color: #2a2f3a;
}
.modal .qty button:hover { background-color: #d9dce2; }
.modal .qty input {
    background-color: #fff;
    color: #2a2f3a;
    border-color: #c8ccd4;
}

/* Modal içi numaralı/işaretli liste — reset'in kaldırdığı işaretleri geri verir */
.modal__body ol,
.modal__body ul {
    padding-left: 20px;
    line-height: 1.7;
}

.modal__body ol { list-style: decimal; }
.modal__body ul { list-style: disc; }

/* --------- Onay penceresi --------- */
.confirm-box {
    max-width: 420px;
}

.confirm-box .modal__body {
    font-size: 14px;
    color: #333a47;
}

/* --------- Toast bildirimleri --------- */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: var(--z-toast);
    max-width: 340px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--active-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-modal);
    color: var(--text-primary);
    font-size: 13px;
    animation: toast-in 0.2s ease;
}

.toast.is-hiding {
    animation: toast-out 0.2s ease forwards;
}

.toast--success { border-left-color: var(--green-color); }
.toast--error { border-left-color: var(--red-color); }
.toast--warning { border-left-color: var(--orange-color); }
.toast--info { border-left-color: var(--active-color); }

.toast__icon {
    font-size: 16px;
    line-height: 1.3;
}

.toast__body { flex: 1; }

.toast__title {
    font-weight: 700;
    margin-bottom: 2px;
}

.toast__msg {
    color: var(--text-secondary);
    font-size: 12px;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}
