/* Floating Header Styles */
.floating-phones-header {
    display: flex;
    justify-content: space-around ; 
    align-items: center;
    background: #4a90e2;
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    text-align: center;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: fixed;
    top: -100px; /* Hidden by default */
    left: 50%; /* Ensure it starts from the center */
    transform: translateX(-50%); /* Shift it back to center by default */
    z-index: 1000;
    transition: top 0.3s ease-in-out;
    opacity: 0;
    visibility: hidden;
    width: 90%; /* Set width to 90% to ensure it fits within the page */
    max-width: 1200px; /* Set maximum width to avoid it being too wide on large screens */
}

.floating-phones-header.visible {
    top: 10px;
    opacity: 1;
    visibility: visible;
}

.floating-phones-header div {
    text-align: center;
}

.floating-phones-header div:first-child {
    text-align: left;
}

.floating-phones-header div:last-child {
    text-align: right;
}

.floating-phones-header .vs-text {
    display: inline-block;
    font-size: 20px;
    color: #333;
    margin: 0 0;
    font-weight: 600;
    padding: 0px 6px;
    border: 2px solid #4a90e2;
    border-radius: 4px;
    background-color: #fff;
}

/* Responsive styles for floating header */
@media screen and (max-width: 768px) {
    .floating-phones-header {
        font-size: 14px;
        padding: 12px;
        width: 95%; /* Make it slightly wider on smaller screens */
        transform: translateX(-50%); /* Default centering for smaller screens */
    }
}

@media screen and (max-width: 480px) {
    .floating-phones-header {
        font-size: 12px;
        padding: 10px;
        width: 100%; /* Ensure full width on very small screens */
    }
}

/* Styles for larger screens (Desktop) */
@media screen and (min-width: 769px) {
    .floating-phones-header {
        transform: translateX(-50%); /* Center for desktop screens */
        top: 66px !important; /* Ensure top value of 66px for desktop screens */
    }
}

/* Print styles for floating header */
@media print {
    .floating-phones-header {
        display: none;
    }
}

/* Basic Reset */
.phone-comparison-wrapper {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    direction: ltr;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Main Wrapper Styling */
.phone-comparison-wrapper {
    background: transparent;
    border-radius: 8px;
    margin-bottom: 40px;
    padding: 15px;
}

/* Fixed phones-header to align properly */
.phones-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #4a90e2;
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    text-align: center;
    border-radius: 8px 8px 0 0;
    font-size: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Adjusted header content to ensure proper alignment */
.phones-header div {
    text-align: center;
}

.phones-header div:first-child {
    text-align: left;
}

.phones-header div:last-child {
    text-align: right;
}

/* Simple VS Text Styling with Box */
.vs-text {
    display: inline-block;
    font-size: 20px;
    color: #333;
    margin: 0 10px;
    font-weight: 600;
    padding: 5px 10px; /* Added padding inside the box */
    border: 2px solid #4a90e2; /* Box border around the text */
    border-radius: 4px; /* Rounded corners for the box */
    background-color: #fff; /* White background for better contrast */
}

/* Section Styling */
.phone-comparison-section {
    background: #fff;
    border: 1px solid #827f7f80;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin: 25px 0;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.phone-comparison-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Section Headers */
.section-header {
    background: #d0d0d075;
    color: #333;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #4a90e2;
}

.section-header i {
    color: #4a90e2;
    font-size: 20px;
}

/* Table Styling */
.phone-comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    table-layout: fixed;
}

.phone-comparison-table th,
.phone-comparison-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 0;
    line-height: 1.6;
}

/* Specification Fields */
.phone-comparison-table th:first-child,
.phone-comparison-table td:first-child {
    background: #f1f8ff;
    color: #2c5282;
    font-weight: 600;
    width: 25%;
    border-right: 1px solid #e9ecef;
    white-space: normal;
    position: relative;
}

/* Table Cell Styling */
.phone-comparison-table td:not(:first-child) {
    text-align: center;
    color: #444;
    width: 37.5%;
    white-space: normal;
    transition: background-color 0.2s ease;
}

/* Section Content */
.section-content {
    padding: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

/* Hover Effects */
.phone-comparison-table tr:hover td {
    background-color: #f5f8ff;
}

.phone-comparison-table tr:hover td:first-child {
    background-color: #e8f4ff;
}

.phone-comparison-table tr:hover td:first-child::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #4a90e2;
}

/* English-specific Typography */
.section-header,
.phones-header div,
.phone-comparison-table td,
.phone-comparison-table th {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .phones-header {
        font-size: 14px;
        padding: 12px;
    }

    .phones-header div {
        font-size: 14px;
    }

    .phone-comparison-table th,
    .phone-comparison-table td {
        padding: 12px;
        font-size: 14px;
    }

    .section-header {
        font-size: 16px;
        padding: 14px 15px;
    }
}

@media screen and (max-width: 480px) {
    .phone-comparison-wrapper {
        padding: 10px;
    }

    .phones-header {
        font-size: 12px;
        padding: 10px;
    }

    .phone-comparison-table th,
    .phone-comparison-table td {
        padding: 10px;
        font-size: 12px;
    }

    .phone-comparison-table th:first-child,
    .phone-comparison-table td:first-child {
        width: 30%;
    }

    .phone-comparison-table td:not(:first-child) {
        width: 35%;
    }

    .section-header {
        padding: 12px;
    }
}

/* Print Styles */
@media print {
    .phone-comparison-section {
        box-shadow: none;
        margin-bottom: 30px;
        page-break-inside: avoid;
        border: 1px solid #ddd;
    }

    .phones-header {
        background: #fff;
        color: #000;
        border: 1px solid #ddd;
    }

    .section-header {
        background: #fff;
        border-bottom: 2px solid #000;
    }

    .phone-comparison-table th:first-child,
    .phone-comparison-table td:first-child {
        background: #f9f9f9;
    }
}

/* LTR Specific Adjustments */
.phone-comparison-wrapper,
.phones-header,
.section-header,
.phone-comparison-table th,
.phone-comparison-table td {
    direction: ltr;
    text-align: left;
}

.phone-comparison-table td:not(:first-child) {
    text-align: center;
    background-color: white;
}

/* Custom Scrollbar for LTR */
.phone-comparison-wrapper ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.phone-comparison-wrapper ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.phone-comparison-wrapper ::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 4px;
}

.phone-comparison-wrapper ::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}