/*
 * Styles for the Plan Table Layout (Shortcode)
 * File: assets/css/elements/plan-table.css
 * Version: 6.0: Aggressively Cleaned.
 * Removed all generic table styles. Only keeps Wrapper (Scroll), Search, and Content Styling.
 */

/* ==========================================================================
   1. Table Wrapper & Controls (Search)
   ========================================================================== */

.py-plan-table-wrapper {
    width: 100%;
    overflow-x: auto; /* Enables Horizontal Scroll */
    margin-bottom: 30px;
    border: 1px solid var(--py-border-color);
    border-radius: var(--py-border-radius);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Search Box Container */
.py-plan-table-controls {
    padding: 15px;
    border-bottom: 1px solid var(--py-border-color);
    background-color: #fff;
}

/* Search Input Field */
.py-table-search {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid var(--py-border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}
.py-table-search:focus {
    outline: none;
    border-color: var(--py-primary-color);
    box-shadow: 0 0 0 2px rgba(var(--py-primary-rgb), 0.2);
}

/* ==========================================================================
   2. Table Layout Overrides (Specific to Scrollable Wrapper)
   ========================================================================== */

.py-plan-table {
    /* Global CSS sets width: 100% and border-collapse. We don't repeat that. */
    margin-bottom: 0; /* Override global margin to fit in wrapper */
    min-width: 600px; /* Force width to trigger scroll on mobile */
    border: none; /* Remove border because Wrapper has it */
}

.py-plan-table th,
.py-plan-table td {
    /* Global CSS sets padding and border. We only add alignment. */
    vertical-align: middle;
    white-space: nowrap; /* Keeps content on one line for scrolling table */
}

/* Remove border from last row so it sits flush in the wrapper */
.py-plan-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   3. Content Styling (Specific Data Columns)
   ========================================================================== */
/* Note: These are NOT generic table styles. These style the specific DATA inside the table. */

/* Plan Name Column */
.py-col-name { 
    min-width: 180px; 
}

.py-table-plan-info { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.py-table-logo { 
    width: 24px; 
    height: 24px; 
    object-fit: contain; 
    border-radius: 4px; 
}

.py-table-link { 
    font-weight: 600; 
    color: var(--py-secondary-color); 
    text-decoration: none; 
    line-height: 1.3; 
    white-space: normal; /* Allow title to wrap if needed */
}
.py-table-link:hover { 
    color: var(--py-primary-color); 
}

/* Price Column */
.py-col-price { 
    font-weight: 700; 
    color: var(--py-primary-color); 
}

.py-price-tag { 
    background: rgba(var(--py-primary-rgb), 0.08); 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 0.9rem; 
}

/* Data & Other Columns Text Color */
.py-col-data, 
.py-col-onnet, 
.py-col-offnet, 
.py-col-validity { 
    color: var(--py-text-light); 
}

/* Action Column (Button) */
.py-col-action { 
    text-align: center; 
    width: 80px; 
}

.py-btn-sm { 
    display: inline-block; 
    padding: 6px 12px; 
    font-size: 0.8rem; 
    font-weight: 600; 
    color: #fff; 
    background-color: var(--py-secondary-color); 
    border-radius: 4px; 
    text-decoration: none; 
    transition: background 0.2s; 
    white-space: nowrap; 
}

.py-btn-sm:hover { 
    background-color: var(--py-primary-color); 
    color: #fff; 
}

/* ==========================================================================
   4. Mobile Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
    .hide-mobile { 
        display: none; 
    }
    
    .py-plan-table { 
        min-width: 600px; /* Ensures horizontal scroll triggers */
    }
    
    .py-col-name { 
        min-width: auto; 
        max-width: 140px; 
    }
    
    .py-table-link { 
        font-size: 0.85rem; 
        display: -webkit-box; 
        -webkit-line-clamp: 2; 
        -webkit-box-orient: vertical; 
        overflow: hidden; 
    }
    
    .py-table-logo { 
        display: none; 
    }
}