/**
 * Puan Durumu Page CSS
 * Template: page-templates/puan-durumu.php
 * 
 * @package News_Theme
 * @version 1.0.0
 */

/* ===== Layout Overrides ===== */
body .sidebar,
body aside,
body #secondary,
body .widget-area {
    display: none !important;
}

body .content-area,
body .site-main,
body main,
body #primary {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body .entry-title,
body h1.entry-title,
body .page-title,
body header.entry-header {
    display: none !important;
}

body .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* ===== Page Header ===== */
.pd2-page-header {
    background: linear-gradient(135deg, #1e6f9f 0%, #134e6f 100%);
    color: #fff;
    padding: 15px 0;
    margin: 0 0 30px 0;
    box-sizing: border-box;
}

.pd2-page-header-inner {
    width: 1140px;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pd2-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.pd2-title-icon {
    font-size: 20px;
}

.pd2-league-select {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 5px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 180px;
}

.pd2-league-select option {
    background: #1e6f9f;
    color: #fff;
}

/* ===== Container ===== */
.pd2-container {
    width: 1140px;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== Table Container ===== */
.pd2-table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* ===== Table ===== */
.pd2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pd2-table thead {
    background: #2c3e50 !important;
}

.pd2-table th {
    padding: 8px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #2c3e50 !important;
}

.pd2-table th.team-col {
    text-align: left;
    padding-left: 15px;
}

.pd2-table th.puan-col {
    color: #fff;
    font-weight: 700;
    background: #f39c12;
    color: #000;
    width: 55px;
}

.pd2-table tbody tr {
    border-left: 4px solid transparent;
    transition: all 0.15s ease;
}

.pd2-table tbody tr:hover {
    background: #f8fafc;
}

.pd2-table td {
    padding: 6px 8px;
    text-align: center;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.pd2-table td.pos-cell {
    font-weight: 700;
    color: #64748b;
    width: 50px;
}

.pd2-table td.team-cell {
    text-align: left;
    padding-left: 15px;
    font-weight: 500;
    color: #1e293b;
}

.pd2-table .team-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

.pd2-table td.points-cell {
    font-weight: 800;
    font-size: 16px;
    color: #1e6f9f;
    background: #fffbeb;
}

/* Position Colors - Champions League (1-5) */
.pd2-table tbody tr:nth-child(1),
.pd2-table tbody tr:nth-child(2),
.pd2-table tbody tr:nth-child(3),
.pd2-table tbody tr:nth-child(4),
.pd2-table tbody tr:nth-child(5) {
    border-left-color: #22c55e;
}

.pd2-table tbody tr:nth-child(1) td.pos-cell,
.pd2-table tbody tr:nth-child(2) td.pos-cell,
.pd2-table tbody tr:nth-child(3) td.pos-cell,
.pd2-table tbody tr:nth-child(4) td.pos-cell,
.pd2-table tbody tr:nth-child(5) td.pos-cell {
    color: #22c55e;
}

/* Relegation Zone (16-17-18) */
.pd2-table tbody tr:nth-child(n+16) {
    border-left-color: #ef4444;
}

.pd2-table tbody tr:nth-child(n+16) td.pos-cell {
    color: #ef4444;
}

/* ===== Legend ===== */
.pd2-legend {
    display: flex;
    gap: 25px;
    padding: 15px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-bar {
    width: 4px;
    height: 16px;
    border-radius: 2px;
}

.legend-bar.cl {
    background: #22c55e;
}

.legend-bar.rel {
    background: #ef4444;
}

/* ===== Update Info ===== */
.pd2-update-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #666;
}

.update-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Loading ===== */
.loading-cell {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* ===== Dark Mode ===== */
body.dark-mode .pd2-page-header {
    background: linear-gradient(135deg, #1a4d6b 0%, #0f2f40 100%);
}

body.dark-mode .pd2-table-container {
    background: var(--dark-bg-secondary, #1a1a1a);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

body.dark-mode .pd2-table thead {
    background: linear-gradient(135deg, #1a3a4a 0%, #0f2833 100%) !important;
}

body.dark-mode .pd2-table th {
    background: linear-gradient(135deg, #1a3a4a 0%, #0f2833 100%) !important;
    color: var(--dark-text-primary, #ffffff) !important;
}

body.dark-mode .pd2-table th.puan-col {
    background: linear-gradient(135deg, #d68910 0%, #b8740d 100%) !important;
    color: #000 !important;
}

body.dark-mode .pd2-table tbody tr {
    background: var(--dark-bg-secondary, #1a1a1a);
}

body.dark-mode .pd2-table tbody tr:hover {
    background: var(--dark-bg-tertiary, #252525);
}

body.dark-mode .pd2-table td {
    color: var(--dark-text-secondary, #b0b0b0);
    border-bottom: 1px solid var(--dark-border, #2a2a2a);
}

body.dark-mode .pd2-table td.pos-cell {
    color: var(--dark-text-secondary, #888);
}

body.dark-mode .pd2-table td.team-cell {
    color: var(--dark-text-primary, #e0e0e0);
}

body.dark-mode .pd2-table td.points-cell {
    color: #4299e1;
    background: rgba(66, 153, 225, 0.1);
}

/* Dark Mode - Position Colors */
body.dark-mode .pd2-table tbody tr:nth-child(1) td.pos-cell,
body.dark-mode .pd2-table tbody tr:nth-child(2) td.pos-cell,
body.dark-mode .pd2-table tbody tr:nth-child(3) td.pos-cell,
body.dark-mode .pd2-table tbody tr:nth-child(4) td.pos-cell,
body.dark-mode .pd2-table tbody tr:nth-child(5) td.pos-cell {
    color: #4ade80;
}

body.dark-mode .pd2-table tbody tr:nth-child(n+16) td.pos-cell {
    color: #f87171;
}

/* Dark Mode - Legend */
body.dark-mode .pd2-legend {
    background: var(--dark-bg-primary, #0d0d0d);
    border-top: 1px solid var(--dark-border, #2a2a2a);
    color: var(--dark-text-secondary, #888);
}

body.dark-mode .legend-bar.cl {
    background: #4ade80;
}

body.dark-mode .legend-bar.rel {
    background: #f87171;
}

/* Dark Mode - Update Info */
body.dark-mode .pd2-update-info {
    background: var(--dark-bg-primary, #0d0d0d);
    border-top: 1px solid var(--dark-border, #2a2a2a);
    color: var(--dark-text-secondary, #888);
}

body.dark-mode .update-dot {
    background: #4ade80;
}

body.dark-mode .loading-cell {
    color: var(--dark-text-secondary, #888);
}

body.dark-mode .pd2-league-select {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

body.dark-mode .pd2-league-select option {
    background: #1a4d6b;
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .pd2-page-header-inner,
    .pd2-container {
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .pd2-page-header-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .pd2-league-select {
        width: 100%;
    }
    
    .pd2-table th,
    .pd2-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .pd2-table .hide-mobile {
        display: none;
    }
    
    .pd2-legend {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .pd2-title {
        font-size: 16px;
    }
    
    .pd2-table th,
    .pd2-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .pd2-table .team-logo-img {
        width: 18px;
        height: 18px;
        margin-right: 5px;
    }
    
    .pd2-table td.points-cell {
        font-size: 14px;
    }
}