/* TTM Squeeze Pro Dashboard Styles */

:root {
    --squeeze-red: #dc3545;
    --squeeze-orange: #fd7e14;
    --squeeze-yellow: #ffc107;
    --squeeze-green: #28a745;
    --squeeze-long: #00c853;
    --squeeze-short: #ff5252;
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(90deg, var(--squeeze-red), #ff6b6b);
    color: white;
    padding: 0.75rem 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Stats Cards */
.stat-card {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #333;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.tight { border-color: var(--squeeze-red); }
.stat-card.tight .stat-icon { color: var(--squeeze-red); }
.stat-card.tight .stat-value { color: var(--squeeze-red); }

.stat-card.medium { border-color: var(--squeeze-orange); }
.stat-card.medium .stat-icon { color: var(--squeeze-orange); }
.stat-card.medium .stat-value { color: var(--squeeze-orange); }

.stat-card.loose { border-color: var(--squeeze-yellow); }
.stat-card.loose .stat-icon { color: var(--squeeze-yellow); }
.stat-card.loose .stat-value { color: var(--squeeze-yellow); }

.stat-card.fired {
    border-color: var(--squeeze-green);
    background: linear-gradient(135deg, #1e1e1e 0%, rgba(0, 200, 83, 0.1) 100%);
}
.stat-card.fired .stat-icon { color: var(--squeeze-green); }
.stat-card.fired .stat-value { color: var(--squeeze-green); }

.stat-card.long { border-color: var(--squeeze-long); }
.stat-card.long .stat-icon { color: var(--squeeze-long); }
.stat-card.long .stat-value { color: var(--squeeze-long); }

.stat-card.short { border-color: var(--squeeze-short); }
.stat-card.short .stat-icon { color: var(--squeeze-short); }
.stat-card.short .stat-value { color: var(--squeeze-short); }

/* Squeeze Panel Headers */
.squeeze-header-tight {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.3), rgba(220, 53, 69, 0.1));
    border-bottom: 2px solid var(--squeeze-red);
}

.squeeze-header-medium {
    background: linear-gradient(90deg, rgba(253, 126, 20, 0.3), rgba(253, 126, 20, 0.1));
    border-bottom: 2px solid var(--squeeze-orange);
}

/* Squeeze List */
.squeeze-list {
    max-height: 400px;
    overflow-y: auto;
}

.squeeze-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.squeeze-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.squeeze-item:last-child {
    border-bottom: none;
}

.squeeze-ticker {
    font-weight: 700;
    font-size: 1rem;
    min-width: 60px;
}

.squeeze-rs {
    color: #888;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.squeeze-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.squeeze-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.squeeze-badge.tight {
    background: var(--squeeze-red);
    color: white;
}

.squeeze-badge.medium {
    background: var(--squeeze-orange);
    color: white;
}

.squeeze-badge.loose {
    background: var(--squeeze-yellow);
    color: #000;
}

.squeeze-badge.fired {
    background: var(--squeeze-green);
    color: white;
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px var(--squeeze-green); }
    to { box-shadow: 0 0 15px var(--squeeze-green); }
}

.momentum-badge {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.momentum-badge.long {
    background: rgba(0, 200, 83, 0.2);
    color: var(--squeeze-long);
}

.momentum-badge.short {
    background: rgba(255, 82, 82, 0.2);
    color: var(--squeeze-short);
}

.momentum-badge.weak {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.momentum-badge.recv {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}

.momentum-badge.trend {
    background: rgba(0, 188, 212, 0.2);
    color: #00bcd4;
    border: 1px solid #00bcd4;
}

.momentum-badge.at-mean {
    background: rgba(138, 43, 226, 0.2);
    color: #ba68c8;
    border: 1px solid #ba68c8;
}

/* Table Styles */
.table-header-sticky {
    position: sticky;
    top: 0;
    background: #1e1e1e;
    z-index: 10;
}

.table-header-sticky th {
    border-bottom: 2px solid #444;
    padding: 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: #fff;
}

#squeezeTable td {
    vertical-align: middle;
    padding: 0.5rem 0.75rem;
}

/* Squeeze Cell Styles */
.squeeze-cell {
    text-align: center;
    min-width: 80px;
}

.squeeze-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.squeeze-indicator.R {
    background: rgba(220, 53, 69, 0.2);
    color: var(--squeeze-red);
    border: 1px solid var(--squeeze-red);
}

.squeeze-indicator.O {
    background: rgba(253, 126, 20, 0.2);
    color: var(--squeeze-orange);
    border: 1px solid var(--squeeze-orange);
}

.squeeze-indicator.Y {
    background: rgba(255, 193, 7, 0.2);
    color: var(--squeeze-yellow);
    border: 1px solid var(--squeeze-yellow);
}

.squeeze-indicator.G {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.squeeze-indicator.F {
    background: var(--squeeze-green);
    color: white;
    animation: glow 1.5s ease-in-out infinite alternate;
}

.squeeze-indicator .bars {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Setup Badge in Table */
.setup-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.setup-badge.long {
    background: linear-gradient(135deg, var(--squeeze-long), #00a844);
    color: white;
}

.setup-badge.short {
    background: linear-gradient(135deg, var(--squeeze-short), #d32f2f);
    color: white;
}

.setup-badge.neutral {
    background: #333;
    color: #888;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 992px) {
    .squeeze-list {
        max-height: 300px;
    }

    /* Table - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #squeezeTable {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .stat-card {
        padding: 0.75rem;
    }

    .stat-card .stat-value {
        font-size: 1.25rem;
    }

    .stat-card .stat-icon {
        font-size: 1.25rem;
    }

    .stat-card .stat-label {
        font-size: 0.65rem;
    }

    /* Squeeze items - more compact */
    .squeeze-item {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .squeeze-info {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .squeeze-badge,
    .momentum-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
    }

    /* Filter buttons - wrap */
    .navbar .btn-group {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .navbar .btn-group .btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 576px) {
    /* Stat cards - stack icon above */
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .stat-card .stat-icon {
        font-size: 1rem;
    }

    .stat-card .stat-label {
        font-size: 0.6rem;
    }

    /* Squeeze ticker */
    .squeeze-ticker {
        font-size: 0.9rem;
        min-width: 50px;
    }

    .squeeze-rs {
        font-size: 0.7rem;
    }

    /* Table cells - smaller */
    .squeeze-cell {
        min-width: 60px;
    }

    .squeeze-indicator {
        font-size: 0.7rem;
        padding: 0.15rem 0.35rem;
    }

    .squeeze-indicator .bars {
        font-size: 0.6rem;
    }

    /* Setup badge */
    .setup-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }

    /* Alert banner */
    .alert-banner {
        font-size: 0.8rem;
        padding: 0.5rem 0;
    }
}

/* Animation for new items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.squeeze-item.new {
    animation: slideIn 0.3s ease-out;
}

/* Ticker link style */
.ticker-link {
    color: inherit;
    text-decoration: none;
}

.ticker-link:hover {
    color: #2196f3;
}
