/* css/fiyatlar.css */

.price-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    border-top: 4px solid transparent;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Cam morfolojisi ve ince yansıma efekti */
.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.price-card:hover::before {
    opacity: 1;
}

/* Bootstrap .card-header override */
.price-card .card-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    padding: 0 !important;
    background: transparent !important;
    border-bottom: none !important;
    border-radius: 0 !important;
}

.price-card .card-label {
    font-size: 0.7rem !important;
    font-weight: 900 !important;
    letter-spacing: 1.5px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-transform: uppercase !important;
}

.price-card .card-header-top {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
}

.price-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg), 0 12px 20px rgba(0, 229, 255, 0.1);
}

.price-card.cheap-ac {
    border-top: 4px solid var(--warning-text);
}

.price-card.cheap-dc {
    border-top: 4px solid var(--danger-text);
}

.price-card.fast-dc {
    border-top: 4px solid var(--primary-color);
}

.price-card.total-power {
    border-top: 4px solid var(--success-text);
}

.price-card.total-stations {
    border-top: 4px solid var(--info-text);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-light);
    min-width: 800px;
}

th {
    text-align: left;
    padding: 20px;
    background: var(--bg-soft);
    font-size: 0.8rem;
    font-weight: 950;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.95rem;
}

@media (max-width: 1200px) {
    .filter-container {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    table {
        min-width: 700px;
    }

    .table-responsive {
        margin: 0 -0.5rem;
        width: calc(100% + 1rem);
        border-radius: 12px;
    }

    .filter-container {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
        flex: 1 1 45%;
        min-width: 120px;
    }

    .price-card {
        padding: 1.25rem;
    }

    .price-val {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        flex: 1 1 100%;
    }
    
    .brand-logo-sm {
        width: 45px;
        height: 45px;
    }
}

/* 601px–1024px: Yatay kaydırma modu — tablo yapısını koru */
@media (max-width: 1024px) and (min-width: 601px) {
    #pricingTable, 
    #pricingTable thead, 
    #pricingTable tbody, 
    #pricingTable th, 
    #pricingTable td, 
    #pricingTable tr { 
        display: table !important; 
        width: 100% !important;
    }
    #pricingTable thead {
        display: table-header-group !important;
    }
    #pricingTable tbody tr {
        display: table-row !important;
    }
    #pricingTable tbody td {
        display: table-cell !important;
    }
    #pricingTable tbody td::before {
        display: none !important;
        content: "" !important;
    }
    .premium-table-wrapper.table-responsive {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
    #pricingTable {
        min-width: 750px !important;
        table-layout: fixed !important;
    }
    #pricingTable td:last-child,
    #pricingTable th:last-child {
        text-align: center !important;
        min-width: 110px !important;
    }
    #pricingTable .brand-box {
        min-width: 180px !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* ≤600px: Kart düzeni — her satır ayrı bir kart, başlıklar data-label'dan */
@media (max-width: 600px) {
    .premium-table-wrapper.table-responsive {
        overflow-x: visible !important;
        border: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    #pricingTable {
        min-width: 0 !important;
        width: 100% !important;
        table-layout: auto !important;
    }

    /* Thead'i gizle — başlıklar data-label'dan gelecek */
    #pricingTable thead {
        display: none !important;
    }

    /* colgroup'u devre dışı bırak */
    #pricingTable colgroup,
    #pricingTable col {
        display: none !important;
    }

    #pricingTable tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    #pricingTable tbody tr {
        display: block !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 16px !important;
        padding: 0 !important;
        overflow: hidden !important;
        box-shadow: var(--shadow-md) !important;
    }

    #pricingTable tbody tr:hover {
        background: var(--bg-card) !important;
        border-color: var(--primary-color) !important;
    }

    #pricingTable tbody td {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 16px !important;
        border-top: 1px dashed var(--border-color) !important;
        position: relative !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* İlk td (operatör) özel stil — tam genişlik, başlık yok */
    #pricingTable tbody td:first-child {
        border-top: none !important;
        padding: 14px 16px !important;
        background: var(--bg-soft) !important;
        border-bottom: 2px solid var(--border-color) !important;
        justify-content: flex-start !important;
    }
    #pricingTable tbody td:first-child::before {
        display: none !important;
    }

    /* data-label'dan başlık göster */
    #pricingTable tbody td::before {
        content: attr(data-label) !important;
        display: block !important;
        font-size: 0.65rem !important;
        font-weight: 900 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        color: var(--text-muted) !important;
        flex-shrink: 0 !important;
        margin-right: 8px !important;
    }

    /* brand-box mobil optimize */
    #pricingTable .brand-box {
        min-width: 0 !important;
        gap: 10px !important;
        width: 100% !important;
    }

    #pricingTable .brand-logo {
        width: 38px !important;
        height: 38px !important;
        flex-shrink: 0 !important;
    }

    /* Profil butonu mobil */
    #pricingTable .profil-btn {
        width: auto !important;
        padding: 0.4rem 0.9rem !important;
        font-size: 0.72rem !important;
    }

    /* İstasyon badge */
    #pricingTable .station-count-cell {
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }

    /* text-center hizalamasını override et */
    #pricingTable tbody td.text-center {
        text-align: right !important;
    }
}

.price-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-light);
}

.price-val.dc {
    color: var(--danger-text);
}

.price-val.ac {
    color: var(--warning-text);
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-label {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 1.5px;
}

.cheap-ac .card-label {
    color: var(--warning-text);
}

.cheap-dc .card-label {
    color: var(--danger-text);
}

.fast-dc .card-label {
    color: var(--primary-color);
}

.total-power .card-label {
    color: var(--success-text);
}

.total-stations .card-label {
    color: var(--info-text);
}

.brand-logo-sm {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--logo-bg);
    border: 1px solid var(--border-color);
    padding: 5px;
    object-fit: contain;
}

.card-brand {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.card-operator {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-price {
    font-size: 1.5rem;
    font-weight: 800;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--logo-bg);
    border: 1px solid var(--border-color);
    padding: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--success-text));
    color: var(--text-light) !important;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    text-shadow: none;
    font-weight: 950;
}

.filter-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-soft);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    align-items: center;
}

.location-filter {
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    outline: none;
    font-weight: 800;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
}

.location-filter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
