/* Mobile-Only CSS - No responsive breakpoints, optimized for mobile devices only */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(to bottom, #f8f9fa, #e9ecef);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: #333;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    width: 100vw;
    overflow-x: hidden;
}

/* Header Styles */
.topheader {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background: #007bff;
    color: white;
    text-align: center;
}

.email_header {
    width: 100%;
    margin-bottom: 8px;
    font-size: 14px;
}

.header_right {
    font-size: 14px;
    text-align: center;
    color: white;
    margin: 0;
}

.currency_header {
    font-size: 12px;
    text-align: center;
    width: 100%;
}

/* Menu Header */
.menu_header {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand {
    text-align: center;
    margin-bottom: 10px;
}

.brand h1 {
    font-size: 1.4rem;
    margin: 0;
}

.brand h1 a {
    color: #333;
    text-decoration: none;
}

.tagline {
    font-size: 0.8rem;
    font-style: italic;
    color: #666;
    margin: 3px 0;
}

/* Search Bar Mobile-Optimized */
.header_appstore_div {
    width: 100%;
}

.Search_div {
    width: 100%;
    padding: 0 10px;
}

#searchme {
    width: 100%;
    padding: 10px 35px 10px 15px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') no-repeat right 12px center;
    background-size: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#searchme:focus {
    border-color: #007bff;
    box-shadow: 0 2px 5px rgba(0,123,255,0.2);
}

/* Main Title */
h1 {
    font-size: 1.25rem;
    text-align: center;
    color: #444;
    padding: 10px 15px;
    margin: 10px 0;
}

#title1 {
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Stats Bars */
.category-stats-bar-index {
    text-align: center;
    padding: 8px 15px;
    font-size: 14px;
    background: #f8f9fa;
    margin: 5px 0;
}

.font-weight-bold {
    font-weight: 600;
}

/* Ranking Bar */
.ranking-bar {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    overflow-x: auto;
    white-space: nowrap;
    margin: 10px 0;
}

.ranking-bar span.ranked-by {
    margin-right: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.ranking-bar span.option {
    color: #222;
    border-radius: 20px;
    padding: 6px 12px;
    background-color: #fff;
    font-weight: 400;
    margin-left: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 13px;
    display: inline-block;
    flex-shrink: 0;
}

.ranking-bar span.active {
    background-color: #dc3545 !important;
    color: white !important;
    font-weight: 600 !important;
}

/* Table Container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0;
}

.table-container {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin: 10px;
    overflow: hidden;
    background: white;
}

/* Table Styles */
.marketcap-table {
    width: 100%;
    background-color: #fff;
    font-size: 13px;
    border-collapse: separate;
    border-spacing: 0;
}

.marketcap-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.marketcap-table th {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.marketcap-table th .th_title {
    font-size: 11px;
    color: #495057;
}

.Sorttable {
    display: none; /* Hide sort icons on mobile */
}

.marketcap-table tbody tr {
    border-bottom: 1px solid #e8e8e8;
}

.marketcap-table tbody tr:active {
    background-color: #f1f3f5;
}

.marketcap-table td {
    padding: 12px 8px;
    font-size: 13px;
    vertical-align: middle;
    border-bottom: 1px solid #e8e8e8;
}

/* Rank Column */
.rank-td {
    font-weight: 600;
    color: #666;
    text-align: center;
    width: 40px;
}

/* Company Name Cell */
.name-td {
    min-width: 120px;
}

.name-td a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.company-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 8px;
    flex-shrink: 0;
}

.nom_entreprise {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
}

/* Favorite Button */
.favorites-col {
    width: 40px;
}

.fav-cell {
    text-align: center;
    width: 40px;
}

.favorite-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    outline: none;
}

.favorite-btn img {
    width: 20px;
    height: 20px;
}

.favorite-btn.favorited img {
    filter: brightness(1.5) saturate(2);
}

/* Price and Change Columns */
.td-right {
    text-align: right;
    font-weight: 500;
}

.green {
    color: #28a745;
}

.red {
    color: #dc3545;
}

.rh-sm {
    font-size: 12px;
    white-space: nowrap;
}

/* Chart Column */
.chart_div {
    height: 50px;
    width: 100px;
    padding: 2px;
}

.chart_div canvas {
    max-width: 100%;
    height: auto;
}

/* Bottom Update Text */
.MiseaJour_bottom {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    font-style: italic;
    color: #666;
    background: #f8f9fa;
}

/* Description Section */
.BottomListeDescription {
    padding: 15px;
    color: #495057;
    font-size: 13px;
    line-height: 1.6;
}

.BottomListeDescription p {
    margin: 0;
    text-align: justify;
}

/* Footer */
.footer-container {
    padding: 20px 15px;
    background-color: #f5f7f7;
}

.footer-section {
    width: 100%;
}

.row {
    display: flex;
    flex-direction: column;
}

.col-sm-6 {
    width: 100%;
    padding: 10px 0;
}

.footer h1 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.footer h4 {
    font-size: 0.95rem;
    margin: 15px 0 8px 0;
    color: #495057;
}

.footer {
    font-size: 13px;
    line-height: 1.5;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

.contact-email {
    font-size: 13px;
    word-break: break-word;
}

/* Hidden Elements */
.hidden {
    display: none !important;
}

.is-hidden {
    display: none;
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:active {
    opacity: 0.7;
}

/* Utilities */
.centered {
    text-align: center;
}

.blackimportant {
    color: black !important;
}

/* Remove desktop-only elements */
.appstore_app,
.appstoreimg,
.appstoreimg_header,
.appstorelink,
#search-box,
#search-results {
    display: none !important;
}

/* Scrollbar styling for mobile */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:active {
    background: #555;
}

/* Improve touch targets */
button, a, .rankk {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Optimize table for mobile viewing */
@supports (-webkit-overflow-scrolling: touch) {
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix for iOS tap highlight */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Ensure text is readable on small screens */
p, span, div {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    .rankk.option.new-feature {
        position: relative;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-weight: 600;
        padding: 8px 35px 8px 12px;
        font-size: 13px;
        transition: all 0.3s ease;
    }

    .rankk.option.new-feature:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    }

    .new-badge {
        position: absolute;
        top: -6px;
        right: -6px;
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        color: white;
        font-size: 8px;
        font-weight: 700;
        padding: 2px 5px;
        border-radius: 8px;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 6px rgba(245, 87, 108, 0.4);
        animation: pulse-badge 2s ease-in-out infinite;
    }

    @keyframes pulse-badge {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.08);
        }
    }

    /* Optional: Adjust ranking-bar for better mobile spacing */
    .ranking-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .ranking-bar span {
        flex-shrink: 0;
    }
}

/* For very small screens */
@media screen and (max-width: 480px) {
    .rankk.option.new-feature {
        padding: 6px 30px 6px 10px;
        font-size: 12px;
    }

    .new-badge {
        font-size: 7px;
        padding: 1px 4px;
        top: -5px;
        right: -5px;
    }
}


/* gainers and losers table */

@media only screen and (max-width: 600px) {

    /* Wrapper box for both tables */
    .gainers-losers-box {
        background: #fff;
        border: 1px solid #ccc;
        border-radius: 10px;
        padding: 10px 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        width: 95%;
        margin: 10px auto;
        font-size: 14px;
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
    }

    /* Section title */
    .gainers-losers-box .section-title {
        text-align: center;
        font-size: 16px;
        font-weight: bold;
        color: #222;
        margin-bottom: 10px;
    }

    /* Each table block */
    .gainers-losers-box .mini-table {
        width: 100%;
        margin-bottom: 14px;
        background: #fdfdfd;
        border: 1px solid #bbb;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        -webkit-border-radius: 8px;
        -moz-border-radius: 8px;
    }

    .gainers-losers-box .mini-table h4 {
        text-align: center;
        font-size: 15px;
        font-weight: 700;
        margin: 5px 0;
        padding: 6px;
        border-bottom: 1px solid #ccc;
        background: linear-gradient(to bottom, #fafafa, #f0f0f0);
    }

    .green-title { color: #0abf4b; }
    .red-title { color: #e3342f; }

    /* Table itself */
    .gainers-losers-box .mini-table table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        border: 1px solid #ccc;
        border-radius: 8px;
        background: #fff;
        text-align: center;
        overflow: hidden;
    }

    .gainers-losers-box .mini-table th,
    .gainers-losers-box .mini-table td {
        border-bottom: 1px solid #ddd;
        border-right: 1px solid #eee;
        padding: 8px 6px;
        font-size: 13px;
        color: #333;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }

    /* Ensure last column doesn’t double-border */
    .gainers-losers-box .mini-table th:last-child,
    .gainers-losers-box .mini-table td:last-child {
        border-right: none;
    }

    .gainers-losers-box .mini-table th {
        background-color: #f3f3f3;
        font-weight: 700;
        color: #222;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    /* Add light shadow hover effect on rows */
    .gainers-losers-box .mini-table tr:hover {
        background-color: #f8f8f8;
        transition: background 0.3s ease;
    }

    .green { color: #0abf4b; font-weight: 600; }
    .red { color: #e3342f; font-weight: 600; }

    /* Update text */
    .gainers-losers-box .last-update {
        text-align: center;
        font-size: 12px;
        color: #777;
        font-style: italic;
        margin-top: 8px;
    }

    /* Scrollbars visible but minimal for Brave/Chrome */
    .gainers-losers-box .mini-table::-webkit-scrollbar {
        height: 6px;
    }

    .gainers-losers-box .mini-table::-webkit-scrollbar-thumb {
        background: #bbb;
        border-radius: 3px;
    }

    .gainers-losers-box .mini-table::-webkit-scrollbar-track {
        background: #f0f0f0;
    }

    /* Force consistent table rendering on WebKit-based browsers (Brave, Safari, Opera) */
    .gainers-losers-box table,
    .gainers-losers-box th,
    .gainers-losers-box td {
        -webkit-border-horizontal-spacing: 0;
        -webkit-border-vertical-spacing: 0;
        border-collapse: separate !important;
        background-clip: padding-box;
    }
}

