/* Frontend styles for Device Pricing Table Plugin - Multi-Device Support */

.dpt-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Multi-Device Container */
.dpt-multi-wrapper {
    margin: 20px 0;
    /* Remove background so footer theme colour shows; keep spacing */
    background: transparent;
    overflow: visible;
}

/* Card styling moved to inner container */
.dpt-multi-wrapper .dpt-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eaed;
}

/* Device Tabs */
.dpt-tabs {
    display: flex;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    padding: 0;
    margin: 0;
    overflow-x: auto;
}

.dpt-tab {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid transparent;
    min-width: 120px;
}

.dpt-tab:hover {
    background-color: rgba(66, 133, 244, 0.1);
    color: #4285f4;
}

.dpt-tab.active {
    background-color: white;
    color: #4285f4;
    border-bottom-color: #4285f4;
    box-shadow: inset 0 -3px 0 #4285f4;
}

/* Tab Content */
.dpt-tab-content {
    position: relative;
}

.dpt-device-content {
    display: none;
    padding: 20px;
}

.dpt-device-content.active {
    display: block;
}

/* Device Title for single device view */
.dpt-device-title {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a73e8;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Search Box */
.dpt-search-wrapper {
    margin-bottom: 20px;
    text-align: center;
}

.dpt-search-input {
    width: 100%;
    max-width: 350px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.dpt-search-input:focus {
    outline: none;
    border-color: #4285f4;
    background-color: white;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15);
}

/* Table Container */
.dpt-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8eaed;
}

.dpt-multi-wrapper .dpt-table-container {
    border: none;
    border-radius: 0;
}

.dpt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
    font-size: 15px;
}

.dpt-table thead tr {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
}

.dpt-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #dee2e6;
}

.dpt-table th:last-child {
    border-right: none;
}

.dpt-table th.dpt-excellent {
    background: #d1e7dd;
    color: #0f5132;
    text-align: center;
}

.dpt-table th.dpt-good {
    background: #fff3cd;
    color: #664d03;
    text-align: center;
}

.dpt-table th.dpt-damaged {
    background: #f8d7da;
    color: #842029;
    text-align: center;
}

.dpt-table th.dpt-code {
    text-align: center;
    background: #e7f1ff;
    color: #0c63e4;
}

.dpt-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dpt-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.dpt-table tbody tr:hover {
    background-color: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dpt-table td {
    padding: 14px 12px;
    vertical-align: middle;
    border-right: 1px solid #f0f0f0;
}

.dpt-table td:last-child {
    border-right: none;
}

/* Device-specific styling */
.dpt-table td.dpt-model {
    font-weight: 500;
    border-left: 4px solid #4285f4;
    background-color: #f8f9ff;
}

/* iPhone specific styling */
.dpt-iphone .dpt-table td.dpt-model {
    color: #1a73e8;
    border-left-color: #4285f4;
}

/* Samsung specific styling */
.dpt-samsung .dpt-table td.dpt-model {
    color: #1976d2;
    border-left-color: #2196f3;
}

/* iPad specific styling */
.dpt-ipad .dpt-table td.dpt-model {
    color: #7b1fa2;
    border-left-color: #9c27b0;
}

.dpt-table td.dpt-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #5f6368;
    text-align: center;
    background-color: #f8f9fa;
    font-weight: 500;
}

.dpt-table td.dpt-excellent {
    text-align: center;
    font-weight: 700;
    color: #137333;
    font-size: 16px;
    background-color: #e6f4ea;
}

.dpt-table td.dpt-good {
    text-align: center;
    font-weight: 700;
    color: #b06000;
    font-size: 16px;
    background-color: #fef7e0;
}

.dpt-table td.dpt-damaged {
    text-align: center;
    font-weight: 700;
    color: #c5221f;
    font-size: 16px;
    background-color: #fce8e6;
}

.dpt-updated {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    color: #5f6368;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
}

.dpt-error {
    background-color: #fce8e6;
    color: #c5221f;
    padding: 16px;
    border: 1px solid #fcd7d4;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
}

/* Add some visual polish */
.dpt-table tbody tr:first-child td {
    border-top: 2px solid #4285f4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dpt-tabs {
        flex-direction: column;
    }
    
    .dpt-tab {
        text-align: center;
        border-bottom: 1px solid #dee2e6;
        border-right: none;
    }
    
    .dpt-tab.active {
        border-bottom: 1px solid #4285f4;
        border-right: none;
        box-shadow: inset 0 -1px 0 #4285f4;
    }
    
    .dpt-device-content {
        padding: 15px;
    }
    
    .dpt-table {
        font-size: 13px;
    }
    
    .dpt-table th,
    .dpt-table td {
        padding: 10px 8px;
    }
    
    .dpt-table th {
        font-size: 12px;
    }
    
    .dpt-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 20px;
    }
    
    .dpt-table td.dpt-excellent,
    .dpt-table td.dpt-good,
    .dpt-table td.dpt-damaged {
        font-size: 14px;
    }
    
    .dpt-device-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .dpt-multi-wrapper {
        margin: 10px 0;
        border-radius: 8px;
    }
    
    .dpt-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .dpt-device-content {
        padding: 10px;
    }
    
    .dpt-table {
        font-size: 12px;
    }
    
    .dpt-table th,
    .dpt-table td {
        padding: 8px 4px;
    }
    
    .dpt-table td.dpt-model {
        border-left: 2px solid #4285f4;
        font-size: 12px;
    }
    
    .dpt-table td.dpt-excellent,
    .dpt-table td.dpt-good,
    .dpt-table td.dpt-damaged {
        font-size: 13px;
    }
    
    .dpt-device-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .dpt-search-input {
        max-width: 100%;
        margin: 0 10px;
    }
}

/* Print styles */
@media print {
    .dpt-search-wrapper,
    .dpt-tabs {
        display: none;
    }
    
    .dpt-device-content {
        display: block !important;
        padding: 0;
    }
    
    .dpt-table-container,
    .dpt-multi-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .dpt-table tbody tr:hover {
        background-color: transparent !important;
        transform: none !important;
        box-shadow: none !important;
    }
    
    .dpt-device-title {
        page-break-after: avoid;
    }
    
    .dpt-table {
        page-break-inside: avoid;
    }
}

/* Legacy compatibility - keep old class names working */
.ipt-wrapper {
    @extend .dpt-wrapper;
}

.ipt-search-wrapper {
    @extend .dpt-search-wrapper;
}

.ipt-search-input {
    @extend .dpt-search-input;
}

.ipt-table-container {
    @extend .dpt-table-container;
}

.ipt-table {
    @extend .dpt-table;
}

.ipt-table th.ipt-excellent {
    @extend .dpt-table th.dpt-excellent;
}

.ipt-table th.ipt-good {
    @extend .dpt-table th.dpt-good;
}

.ipt-table th.ipt-damaged {
    @extend .dpt-table th.dpt-damaged;
}

.ipt-table th.ipt-code {
    @extend .dpt-table th.dpt-code;
}

.ipt-table td.ipt-model {
    @extend .dpt-table td.dpt-model;
}

.ipt-table td.ipt-code {
    @extend .dpt-table td.dpt-code;
}

.ipt-table td.ipt-excellent {
    @extend .dpt-table td.dpt-excellent;
}

.ipt-table td.ipt-good {
    @extend .dpt-table td.dpt-good;
}

.ipt-table td.ipt-damaged {
    @extend .dpt-table td.dpt-damaged;
}

.ipt-updated {
    @extend .dpt-updated;
}

.ipt-error {
    @extend .dpt-error;
}

/* Animation for smooth tab transitions */
.dpt-device-content {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.dpt-device-content.active {
    opacity: 1;
}

/* ------------------------------------------------------------------
   THEME FOOTER PROTECTION
   Prevent any plugin styles from turning footer text white.
------------------------------------------------------------------- */
footer, .site-footer, .elementor-location-footer {
    color: #000 !important;
}
footer a, .site-footer a, .elementor-location-footer a {
    color: #000 !important;
}

/* Mobile enhancements: horizontal scroll with sticky header and better wrapping */
@media (max-width: 768px) {
    .dpt-table-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    /* Ensure the table can scroll horizontally instead of squeezing */
    .dpt-table {
        min-width: 640px;
    }
    /* Keep prices/codes from breaking awkwardly, but allow model names to wrap */
    .dpt-table th,
    .dpt-table td {
        white-space: nowrap;
    }
    .dpt-table td.dpt-model,
    .dpt-table th.dpt-model {
        white-space: normal;
    }
    /* Sticky header inside the scroll container */
    .dpt-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    }
}

/* Compact mobile styles: tighter paddings and font sizes while staying readable */
@media (max-width: 768px) {
    .dpt-search-wrapper { margin-bottom: 12px; }
    .dpt-search-input { padding: 10px 14px; font-size: 16px; }
    .dpt-tab { padding: 12px 16px; font-size: 14px; }

    .dpt-table th,
    .dpt-table td { padding: 10px 8px; line-height: 1.25; }
    .dpt-table td.dpt-model { font-size: 14px; }
    .dpt-table td.dpt-excellent,
    .dpt-table td.dpt-good,
    .dpt-table td.dpt-damaged { font-size: 14px; }
}

@media (max-width: 480px) {
    .dpt-search-input { padding: 10px 12px; font-size: 15px; }

    /* Slightly smaller min width to reduce horizontal scroll on very small screens */
    .dpt-table { min-width: 580px; }

    .dpt-table th,
    .dpt-table td { padding: 8px 6px; line-height: 1.2; }
    .dpt-table td.dpt-model { font-size: 13px; }
    .dpt-table td.dpt-excellent,
    .dpt-table td.dpt-good,
    .dpt-table td.dpt-damaged { font-size: 13px; }
}