/* 📊 Styles Premium pour le Tableau des Actions Tokenisées */

.stocks-table {
    width: 100%;
    min-width: 950px;
    /* Minimum width to contain all data nicely */
    border-collapse: separate;
    border-spacing: 0 12px;
    table-layout: fixed;
    /* Force column widths */
}

.stocks-table-wrapper {
    background: rgba(15, 15, 30, 0.6);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    padding: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 10;
}

.stocks-table th {
    padding: 8px 4px;
    /* Reduced padding to give more width to pills */
    text-align: left;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

/* Fix Col Widths */
.stocks-table th:nth-child(1),
.stocks-table td:nth-child(1) {
    width: 150px;
    /* Increased from 135px */
    text-align: center;
}

.stocks-table th:nth-child(2),
.stocks-table td:nth-child(2) {
    width: 110px;
    /* Increased from 105px */
    text-align: left;
}

.stocks-table th:nth-child(3),
.stocks-table td:nth-child(3) {
    width: 330px;
    text-align: left;
    padding-right: 20px;
}

.stocks-table th:nth-child(4),
.stocks-table td:nth-child(4) {
    width: 120px;
    text-align: center;
}

.stocks-table th:nth-child(5),
.stocks-table td:nth-child(5) {
    width: 110px;
    text-align: center;
}

.stocks-table th:nth-child(6),
.stocks-table td:nth-child(6) {
    width: 190px;
    /* Increased from 160px for "7 Derniers Jours" */
    text-align: center;
}

.stocks-table th:nth-child(7),
.stocks-table td:nth-child(7) {
    width: 150px;
    /* Increased from 130px */
    text-align: left;
}

.header-filter {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    /* Changed from space-between to keep icon with text */
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Center Headers for specific columns */
.stocks-table th:nth-child(1) .header-filter,
.stocks-table th:nth-child(3) .header-filter,
.stocks-table th:nth-child(4) .header-filter,
.stocks-table th:nth-child(5) .header-filter,
.stocks-table th:nth-child(6) .header-filter {
    justify-content: center;
}

.header-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.header-filter span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
}

.header-filter i {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

.header-filter:active i {
    transform: translateY(2px);
}

.stock-row {
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.stock-row:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.stock-row td {
    padding: 15px;
    vertical-align: middle;
}

.stock-row td:first-child {
    border-radius: 12px 0 0 12px;
}

.stock-row td:last-child {
    border-radius: 0 12px 12px 0;
}

/* Badges */
.issuer-badge,
.type-badge,
.blockchain-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 6px;
}

.badge-ondo {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-xstocks {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-stock {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.badge-etf {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-solana {
    background: rgba(20, 241, 149, 0.1);
    color: #14f195;
}

.badge-ethereum {
    background: rgba(98, 126, 234, 0.1);
    color: #627eea;
}

/* Multi-chain display for Ondo */
.multi-chain-badges {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chain-logo {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    padding: 1px;
}

.chain-logo.sol-official,
.chain-logo[title="BNB Chain"],
.chain-logo.matic-official,
.chain-logo.ton-official {
    background: transparent !important;
    padding: 0 !important;
}

.chain-logo:hover {
    transform: scale(1.2) translateY(-2px);
}

.chain-logo[title="Ethereum"]:hover {
    box-shadow: 0 0 12px rgba(98, 126, 234, 0.6);
}

.chain-logo[title="Solana"]:hover {
    box-shadow: 0 0 12px rgba(20, 241, 149, 0.6);
}

.chain-logo[title="BNB Chain"]:hover {
    box-shadow: 0 0 12px rgba(243, 186, 47, 0.6);
}

.chain-logo[title="Polygon"]:hover {
    box-shadow: 0 0 12px rgba(130, 71, 229, 0.6);
}

.chain-logo[title="TON"]:hover {
    box-shadow: 0 0 12px rgba(0, 136, 204, 0.6);
}

.badge-mini-logo {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: middle;
    background: white;
    padding: 1px;
}

.badge-mini-logo.sol-official {
    background: transparent !important;
    padding: 0 !important;
}

/* Entity Info */
.entity-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.entity-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: white;
    padding: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.entity-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: white;
    font-size: 1rem;
    white-space: nowrap;
}

.entity-ticker {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Prices & Changes */
.price-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #10b981;
    /* Vert Premium */
}

.change-value {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.change-value.positive {
    color: #10b981;
}

.change-value.negative {
    color: #ef4444;
}

/* Sparkline */
.sparkline-container {
    width: 120px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.sparkline-svg {
    filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.2));
}

/* Search Bar customization */
#stockSearchInput:focus {
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
    border-color: rgba(138, 43, 226, 0.6) !important;
}

/* Modal / Dropdowns Fix */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: rgba(20, 20, 40, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px;
    z-index: 9999;
    display: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    min-width: 180px;
}

.filter-dropdown.active {
    display: block;
}

.filter-option {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.filter-option.selected {
    background: rgba(138, 43, 226, 0.2);
    color: #a855f7;
    font-weight: 600;
}

.filter-option.selected::after {
    content: "●";
    font-size: 0.6rem;
    color: #a855f7;
    text-shadow: 0 0 5px #a855f7;
}

/* Responsive */
@media (max-width: 768px) {
    .stocks-table-wrapper {
        padding: 10px;
        border-radius: 0;
    }

    .stocks-table th:nth-child(2),
    .stocks-table td:nth-child(2),
    .stocks-table th:nth-child(6),
    .stocks-table td:nth-child(6),
    .stocks-table th:nth-child(7),
    .stocks-table td:nth-child(7) {
        display: none;
    }
}
