/* ==========================================================================
   ONTURK Frontend Components — global responsive CSS
   Listeleme tabloları, chip'ler, kartlar, modal'lar için mobile-first pattern'ler.
   ========================================================================== */

/* ----- Mobile-first container düzeni ----- */
.tx-page main,
.tx-page .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    max-width: 100%;
}
@media (min-width: 768px) {
    .tx-page .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ----- Genel: yatay taşma kilidi ----- */
html, body { overflow-x: hidden; }

/* ----- Kart ----- */
.tx-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
    margin-bottom: 1rem;
    overflow: hidden;
    max-width: 100%;
}
.tx-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
@media (min-width: 768px) { .tx-card-header { padding: 1.25rem 1.5rem; } }
.tx-card-body { padding: 1rem 1.25rem; }
@media (min-width: 768px) { .tx-card-body { padding: 1.5rem; } }

/* ----- Heading ----- */
.tx-h1 {
    font-size: clamp(1.25rem, 4.2vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 0;
}

/* ----- Form ----- */
.tx-form-control {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: .65rem .9rem;
    font-size: 1rem;
    width: 100%;
    max-width: 100%;
}
.tx-form-control:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147, 197, 253, .35);
}
.tx-textarea {
    min-height: 160px;
    line-height: 1.6;
    resize: vertical;
}
.tx-label {
    display: block;
    font-weight: 700;
    margin-bottom: .5rem;
    font-size: .92rem;
    color: #0f172a;
}
.tx-help {
    color: #64748b;
    font-size: .82rem;
    margin-top: .35rem;
}

/* ----- Button ----- */
.tx-btn {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 700;
    padding: .65rem .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .tx-btn-primary-mobile { width: 100%; }
}

/* ----- Info satırı ----- */
.tx-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .6rem;
    font-size: .82rem;
    color: #475569;
    max-width: 100%;
}
.tx-info-row > span {
    max-width: 100%;
    word-break: break-word;
}
.tx-info-row strong { color: #0f172a; word-break: break-word; }

/* ----- Status chip ----- */
.tx-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #0f172a;
    white-space: nowrap;
    max-width: 100%;
}
.tx-chip .dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
}
.tx-chip.is-pending { background: #fef3c7; color: #92400e; }
.tx-chip.is-pending .dot { background: #f59e0b; }
.tx-chip.is-success { background: #dcfce7; color: #166534; }
.tx-chip.is-success .dot { background: #22c55e; }
.tx-chip.is-danger { background: #fee2e2; color: #991b1b; }
.tx-chip.is-danger .dot { background: #ef4444; }
.tx-chip.is-info { background: #dbeafe; color: #1e40af; }
.tx-chip.is-info .dot { background: #3b82f6; }
.tx-chip.is-warning { background: #fef3c7; color: #92400e; }
.tx-chip.is-warning .dot { background: #f59e0b; }
.tx-chip.is-secondary { background: #e2e8f0; color: #475569; }
.tx-chip.is-secondary .dot { background: #94a3b8; }

/* ----- Mini progress ----- */
.tx-mini-progress {
    height: 6px;
    width: 100%;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    max-width: 100%;
}
.tx-mini-progress > span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #60a5fa, #2563eb);
    transition: width .4s ease;
}

/* ----- Alert ----- */
.tx-alert {
    border-radius: 12px;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: .9rem;
    max-width: 100%;
}
.tx-alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* ----- Misc ----- */
.tx-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tx-no-tap-highlight { -webkit-tap-highlight-color: transparent; }

/* ----- Tablo: mobile = stacked card, desktop = normal tablo ----- */
.tx-history-list { width: 100%; }
@media (max-width: 767.98px) {
    .tx-history-list { display: block; border: 0; }
    .tx-history-list thead { display: none; }
    .tx-history-list tbody { display: block; }
    .tx-history-list tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: .65rem .85rem;
        margin-bottom: .65rem;
        box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    }
    .tx-history-list tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        padding: .25rem 0;
        border: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        text-align: right;
        font-size: .85rem;
        word-break: break-word;
    }
    .tx-history-list tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #475569;
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .02em;
        text-align: left;
        flex: 0 0 auto;
        margin-right: .5rem;
    }
    .tx-history-list tbody td.col-date {
        font-weight: 700;
        color: #0f172a;
        border-bottom: 1px solid #f1f5f9 !important;
        margin-bottom: .25rem;
        padding-bottom: .4rem !important;
        display: block;
        text-align: left;
    }
    .tx-history-list tbody td.col-date::before { display: none; }
}
@media (min-width: 768px) {
    .tx-history-list th,
    .tx-history-list td { white-space: nowrap; }
}

/* ----- Mobile helper ----- */
@media (max-width: 575.98px) {
    .tx-hide-mobile { display: none !important; }
    .tx-show-mobile { display: initial !important; }
}
@media (min-width: 576px) {
    .tx-show-mobile { display: none !important; }
    .tx-hide-mobile { display: initial !important; }
}

/* ----- Metin kırma ----- */
.tx-page p, .tx-page small, .tx-page strong, .tx-page span,
.tx-page td, .tx-page th, .tx-page .badge {
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}