/* Dashboard Styles - Luxury Edition */

/* Navbar always visible - auto-hides on scroll */
.navbar {
    z-index: 9999 !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
}

/* Page header spacing - consistent whether navbar is visible or not */
.page-header {
    padding-top: 5px;
    margin-top: -88px;
    padding-top: calc(88px + 5px);
}


/* System Status Bar */
.system-status {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 8px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    box-shadow: none;
    position: relative;
    max-width: 100%;
}

/* Mobile/PWA: More spacing above buttons */
@media (max-width: 768px) {
    .page-header {
        margin-top: -59px;
        padding-top: calc(59px + 12px) !important;
    }
}

/* Desktop layout: 3 equal buttons on one line */
@media (min-width: 768px) {
    .system-status {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
        gap: 10px;
    }

    /* All 3 buttons are equal width */
    .system-status .notification-btn,
    .system-status .settings-toggle-btn,
    .system-status .refresh-btn {
        width: 100%;
    }
}

#nextRefreshCountdown {
    font-weight: 600;
    display: inline-block;
    min-width: 24px;
    text-align: left;
}

/* Active Positions Count Display */
.active-count-display {
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.06) 0%, rgba(160, 82, 45, 0.02) 100%);
    border: 1px solid rgba(160, 82, 45, 0.15);
    color: #A0522D;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    margin-left: auto;
}

/* Mobile/PWA: Reduce padding for more compact display */
@media (max-width: 768px) {
    .active-count-display {
        padding: 4px 12px;
        font-size: 11px;
        border-radius: 6px;
        margin-top: 0;
        margin-bottom: 0;
    }

    #activePositionsCount {
        font-size: 13px;
    }
}

#activePositionsCount {
    font-weight: 700;
    font-size: 15px;
}

/* Settings Toggle Button */
.settings-toggle-btn {
    background: linear-gradient(to bottom, #f8f6f3, #f0ede9);
    color: #6b5d4f;
    border: 1px solid #e0dcd6;
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(107, 93, 79, 0.08);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.settings-toggle-btn .btn-text {
    font-weight: 600;
}

.settings-toggle-btn:hover {
    background: linear-gradient(to bottom, #f0ede9, #e8e3dd);
    border-color: #d4cfc7;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(107, 93, 79, 0.12);
}

.settings-toggle-btn:active {
    transform: translateY(0);
}

.settings-toggle-btn.active {
    background: linear-gradient(to bottom, #e8e3dd, #dad4cb);
    color: #5a4e42;
    border-color: #c9c2b8;
    box-shadow: 0 1px 2px rgba(107, 93, 79, 0.15);
}

.settings-toggle-btn.active:hover {
    background: linear-gradient(to bottom, #dad4cb, #ccc5ba);
    border-color: #b8b0a5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(107, 93, 79, 0.2);
}

/* ===== LUXURY SETTINGS CONTAINER ===== */
.luxury-settings-container {
    margin-top: 40px;
    margin-bottom: 48px;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.luxury-settings-container.show {
    display: grid;
}

/* Signals Container - adds margin when settings are hidden */
.signals-container {
    margin-top: 40px;
}

/* ===== LUXURY CARDS ===== */
.luxury-settings-card {
    background: linear-gradient(145deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow:
        0 4px 16px rgba(23, 162, 184, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(23, 162, 184, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.luxury-settings-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #17a2b8 0%, #20c997 50%, #17a2b8 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}


.luxury-settings-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(23, 162, 184, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.06);
    border-color: rgba(23, 162, 184, 0.2);
}

/* ===== CARD ICON ===== */
.luxury-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.luxury-card-icon svg {
    color: white;
    width: 20px;
    height: 20px;
}

/* ===== CARD TITLES ===== */
.luxury-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
}

.luxury-card-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 16px 0;
    font-weight: 500;
}


/* ===== PRIMARY ACTION ===== */
.luxury-primary-action {
    margin-bottom: 20px;
}

.luxury-toggle-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.luxury-toggle-btn .btn-icon {
    font-size: 18px;
}

.luxury-toggle-btn.notifications-disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.luxury-toggle-btn.notifications-enabled {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.luxury-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.luxury-toggle-btn:active {
    transform: translateY(0);
}

/* ===== SETTINGS GROUP ===== */
.luxury-settings-group {
    background: rgba(248, 250, 252, 0.6);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
}

.luxury-settings-group.compact {
    padding: 12px;
    margin-bottom: 20px;
}

/* ===== SETTING ITEM ===== */
.luxury-setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    gap: 16px;
}

.luxury-setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.luxury-setting-item:first-child {
    padding-top: 0;
}

.luxury-setting-item.compact {
    padding: 12px 0;
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.setting-info.compact {
    gap: 10px;
}

.setting-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.setting-text {
    flex: 1;
    min-width: 0;
}

.setting-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

.setting-description {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

/* ===== LUXURY TOGGLE SWITCH ===== */
.luxury-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    cursor: pointer;
    flex-shrink: 0;
}

.luxury-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.luxury-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 28px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.luxury-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.luxury-toggle-switch input:checked + .luxury-toggle-slider {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.luxury-toggle-switch input:checked + .luxury-toggle-slider:before {
    transform: translateX(20px);
    box-shadow: 0 3px 10px rgba(52, 199, 89, 0.4);
}

/* ===== LUXURY CONTROLS ===== */
.luxury-sound-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.luxury-select {
    padding: 10px 14px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    background: white;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.luxury-select.compact {
    min-width: 90px;
    padding: 9px 12px;
}

.luxury-select:hover {
    border-color: rgba(23, 162, 184, 0.4);
    background: rgba(248, 250, 252, 0.8);
}

.luxury-select:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.luxury-icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(23, 162, 184, 0.2);
    flex-shrink: 0;
}

.luxury-icon-btn svg {
    width: 16px;
    height: 16px;
}

.luxury-icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.luxury-icon-btn:active {
    transform: translateY(0);
}

/* ===== DANGER ZONE ===== */
.luxury-danger-zone {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px dashed rgba(220, 53, 69, 0.2);
}

.luxury-danger-btn {
    padding: 11px 18px;
    border: 2px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    background: rgba(220, 53, 69, 0.05);
    color: #dc3545;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.luxury-danger-btn svg {
    width: 14px;
    height: 14px;
}

.luxury-danger-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}


/* ===== LUXURY INPUTS ===== */
.luxury-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.luxury-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.luxury-input-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.luxury-input-with-symbol {
    position: relative;
    display: flex;
    align-items: center;
}

.luxury-input-with-symbol .input-symbol {
    position: absolute;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
}

.luxury-input-with-symbol .input-symbol:first-child {
    left: 14px;
}

.luxury-input-with-symbol .input-symbol:last-child {
    right: 14px;
}

.luxury-input {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    background: white;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.luxury-input-with-symbol:has(.input-symbol:first-child:not(:last-child)) .luxury-input {
    padding-left: 36px;
}

.luxury-input-with-symbol:has(.input-symbol:last-child:not(:first-child)) .luxury-input {
    padding-right: 36px;
}

.luxury-input:hover {
    border-color: rgba(23, 162, 184, 0.4);
}

.luxury-input:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

/* ===== ACTION BUTTONS ===== */
.luxury-action-btn {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(23, 162, 184, 0.2);
}

.luxury-action-btn svg {
    width: 15px;
    height: 15px;
}

.luxury-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(23, 162, 184, 0.3);
}

.luxury-action-btn:active {
    transform: translateY(0);
}

.luxury-action-btn.success {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    box-shadow: 0 3px 10px rgba(23, 162, 184, 0.2);
}

.luxury-action-btn.success:hover {
    box-shadow: 0 6px 16px rgba(23, 162, 184, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .luxury-settings-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .luxury-settings-card {
        padding: 20px 18px;
        border-radius: 14px;
    }

    .luxury-setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .luxury-sound-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .luxury-select {
        width: 100%;
    }

    .luxury-icon-btn {
        width: 100%;
    }
}

/* OLD STYLES - Keep for backward compatibility */
/* Sound Selector */
.sound-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    margin-left: 16px;
}

.sound-selector select {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid rgba(23, 162, 184, 0.2);
    border-radius: 10px;
    font-size: 16px;
    background: #f8fafc;
    color: #2c3e50;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sound-selector select:hover {
    border-color: rgba(23, 162, 184, 0.4);
    background: white;
}

.sound-selector select:focus {
    outline: none;
    border-color: #17a2b8;
    background: white;
    box-shadow: 0 0 0 4px rgba(23, 162, 184, 0.08);
}

/* Risk Input */
.risk-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid rgba(23, 162, 184, 0.2);
    border-radius: 10px;
    font-size: 16px;
    margin-left: 16px;
    width: auto;
    background: #f8fafc;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
}

.risk-input:hover {
    border-color: rgba(23, 162, 184, 0.4);
    background: white;
}

.risk-input:focus {
    outline: none;
    border-color: #17a2b8;
    background: white;
    box-shadow: 0 0 0 4px rgba(23, 162, 184, 0.08);
}

/* Buttons in Settings Cards */
.settings-card-body button {
    width: 100%;
    margin-top: 16px;
}

.settings-card-body .notification-btn {
    width: 100%;
}

.settings-card-body .pair-filter-btn {
    width: 100%;
    background: linear-gradient(135deg, #17a2b8 0%, #15919e 100%);
    color: white;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-card-body .pair-filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.settings-card-body .pair-filter-btn:active {
    transform: translateY(0);
}

.settings-card-body .apply-risk-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-card-body .apply-risk-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.settings-card-body .apply-risk-btn:active {
    transform: translateY(0);
}

.settings-card-body .hard-reset-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-card-body .hard-reset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.settings-card-body .hard-reset-btn:active {
    transform: translateY(0);
}

.refresh-btn {
    background: linear-gradient(to bottom, #f5f3f0, #ebe8e3);
    color: #6b5d4f;
    border: 1px solid #dad6d0;
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(107, 93, 79, 0.08);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.refresh-btn svg {
    flex-shrink: 0;
}

.refresh-btn:hover {
    background: linear-gradient(to bottom, #ebe8e3, #e0dcd6);
    border-color: #cac5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(107, 93, 79, 0.12);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn.refreshing {
    background: linear-gradient(to bottom, #e0dcd6, #d4cfc7);
    border-color: #bfb9af;
    color: #5a4e42;
    animation: refreshPulse 0.5s ease-in-out;
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes refreshPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

.logout-btn {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(220, 53, 69, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.logout-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(160, 82, 45, 0.1);
    border-top-color: #A0522D;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    color: rgba(160, 82, 45, 0.7);
    font-size: 16px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.error-state h3 {
    color: #A0522D;
    font-size: 24px;
    margin-bottom: 12px;
}

.error-state p {
    color: rgba(160, 82, 45, 0.7);
    font-size: 16px;
    margin-bottom: 24px;
}

.retry-btn {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(160, 82, 45, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(160, 82, 45, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.empty-state h3 {
    color: #A0522D;
    font-size: 24px;
    margin-bottom: 12px;
}

.empty-state p {
    color: rgba(160, 82, 45, 0.7);
    font-size: 16px;
}

/* Signals Grid */
.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-top: 40px;
    margin-bottom: 60px;
}

.signal-card {
    background: linear-gradient(135deg, #ffffff 0%, #FFF9F0 100%);
    border: 2px solid rgba(160, 82, 45, 0.15);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.4s ease;
}

.signal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #A0522D 0%, #D4AF37 100%);
}

.signal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(160, 82, 45, 0.15);
    border-color: rgba(160, 82, 45, 0.3);
}

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.signal-pair {
    font-size: 28px;
    font-weight: 800;
    color: #A0522D;
    letter-spacing: -0.5px;
}

.signal-direction {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signal-direction.direction-buy {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.signal-direction.direction-sell {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.signal-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.signal-status-active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.signal-status-tp,
.signal-status-sl {
    min-width: 130px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.signal-status-tp {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.signal-status-sl {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.signal-status-closed {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    color: white;
}

/* Close timer in TP/SL hit status - fixed width to prevent layout shift */
.close-timer {
    display: inline-block;
    width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Dimmed style for closed signals */
.signal-card.signal-closed {
    opacity: 0.7;
    filter: grayscale(0.3);
}

.signal-card.signal-closed:hover {
    opacity: 0.9;
}

.date-header {
    font-size: 18px;
    font-weight: 700;
    color: #A0522D;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.08) 0%, rgba(160, 82, 45, 0.04) 100%);
    border-left: 4px solid #A0522D;
    margin: 20px 0 15px 0;
    border-radius: 8px;
    grid-column: 1 / -1;
}

.date-header:first-child {
    margin-top: 0;
}

.signal-time {
    font-size: 13px;
    color: rgba(160, 82, 45, 0.6);
    margin-bottom: 5px;
    min-width: 220px;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.signal-datetime {
    font-size: 12px;
    color: rgba(160, 82, 45, 0.5);
    margin-top: 20px;
    margin-bottom: 2px;
    font-weight: 500;
}

.signal-closetime {
    font-size: 12px;
    color: rgba(160, 82, 45, 0.5);
    margin-bottom: 12px;
    font-weight: 500;
}

.signal-details {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr; /* Force each row to take full width - stacks vertically */
}

.signal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(160, 82, 45, 0.05);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.signal-row:hover {
    background: rgba(160, 82, 45, 0.08);
}

.signal-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(160, 82, 45, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signal-value {
    font-size: 17px;
    font-weight: 700;
    color: #A0522D;
}

.signal-entry {
    font-size: 17px !important;
    font-weight: 700 !important;
}

.signal-tp {
    color: #28a745;
}

.signal-sl {
    color: #dc3545;
}

/* Size display - recalculated and original */
.size-recalculated {
    font-weight: 800;
    color: #A0522D;
}

.size-original {
    font-size: 13px;
    font-weight: 500;
    color: rgba(160, 82, 45, 0.6);
    margin-left: 6px;
}

.signal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(160, 82, 45, 0.1);
}

.risk-reward {
    text-align: center;
    padding: 12px;
    background: rgba(160, 82, 45, 0.05);
    border-radius: 12px;
}

.rr-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(160, 82, 45, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.rr-value {
    font-size: 20px;
    font-weight: 800;
    color: #A0522D;
}

.signal-id {
    font-size: 11px;
    color: rgba(160, 82, 45, 0.5);
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(160, 82, 45, 0.1);
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .signals-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .signal-card {
        padding: 20px;
    }

    .signal-pair {
        font-size: 24px;
    }

    .signal-value {
        font-size: 15px;
    }

    .signal-entry {
        font-size: 19px;
    }

    .last-update {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* RTL Support */
[dir="rtl"] .signal-header,
[dir="rtl"] .signal-row,
[dir="rtl"] .last-update {
    flex-direction: row-reverse;
}

[dir="rtl"] .signal-footer {
    direction: ltr;
}

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

/* Notification Button */
.notification-btn {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.notification-btn .btn-icon {
    font-size: 16px;
    line-height: 1;
}

.notification-btn .btn-text {
    font-weight: 600;
}

/* Reset Notifications Button */
.reset-notifications-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(255, 152, 0, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.reset-notifications-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.reset-notifications-btn:active {
    transform: translateY(0);
}

/* Hard Reset Button */
.hard-reset-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(220, 53, 69, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.hard-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.hard-reset-btn:active {
    transform: translateY(0);
}

/* iPhone-style Toggle Group */
.toggle-group {
    display: flex;
    gap: 16px;
    align-items: center;
    background: rgba(160, 82, 45, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #A0522D;
    white-space: nowrap;
    user-select: none;
}

/* iPhone-style Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.toggle-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    -webkit-tap-highlight-color: transparent;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
    -webkit-transform: translateX(20px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hover effect */
.toggle-switch:hover .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(23, 162, 184, 0.06);
}

.notification-btn:active {
    transform: scale(0.98);
}

.notification-btn.notifications-enabled {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    border: 1px solid #10b981;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}

/* Only apply hover on non-touch devices */
@media (hover: hover) and (pointer: fine) {
    .notification-btn.notifications-enabled:hover {
        background: linear-gradient(135deg, #059669 0%, #10b981 100%);
        border-color: #059669;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(16, 185, 129, 0.4);
    }
}

.notification-btn.notifications-disabled {
    background: #ffffff;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.notification-btn.notifications-disabled:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Outside Active Hours - Grey/muted to indicate system is paused */
.notification-btn.notifications-outside-hours {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: white;
    border: 1px solid #6b7280;
    box-shadow: 0 1px 2px rgba(107, 114, 128, 0.3);
}

@media (hover: hover) and (pointer: fine) {
    .notification-btn.notifications-outside-hours:hover {
        background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
        border-color: #4b5563;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(107, 114, 128, 0.4);
    }
}

/* Sound Selector */
.sound-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(160, 82, 45, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.sound-selector label {
    font-size: 13px;
    font-weight: 600;
    color: #A0522D;
    white-space: nowrap;
}

.sound-selector select {
    background: white;
    color: #A0522D;
    border: 1px solid rgba(160, 82, 45, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
}

.sound-selector select:hover {
    border-color: rgba(160, 82, 45, 0.4);
    background: rgba(160, 82, 45, 0.02);
}

.sound-selector select:focus {
    outline: none;
    border-color: #A0522D;
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
}

.preview-btn {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(160, 82, 45, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(160, 82, 45, 0.3);
}

.preview-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .sound-selector {
        width: 100%;
        justify-content: space-between;
    }

    .sound-selector select {
        flex: 1;
    }
}

/* Sound Group - Sound toggle with selector and preview */
.sound-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(160, 82, 45, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.sound-group .toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sound-group select {
    background: white;
    color: #A0522D;
    border: 1px solid rgba(160, 82, 45, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 100px;
}

.sound-group select:hover {
    border-color: rgba(160, 82, 45, 0.4);
    background: rgba(160, 82, 45, 0.02);
}

.sound-group select:focus {
    outline: none;
    border-color: #A0522D;
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
}

.sound-group .preview-btn {
    background: white;
    color: #A0522D;
    border: 2px solid #A0522D;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    -webkit-tap-highlight-color: rgba(160, 82, 45, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.sound-group .preview-btn svg {
    transition: all 0.3s ease;
}

.sound-group .preview-btn:hover {
    background: #A0522D;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(160, 82, 45, 0.3);
}

.sound-group .preview-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(160, 82, 45, 0.2);
}

/* Auto-Dismiss Group - Auto-Dismiss toggle with delay selector */
.autodismiss-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(160, 82, 45, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.autodismiss-group .toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.autodismiss-group select {
    background: white;
    color: #A0522D;
    border: 1px solid rgba(160, 82, 45, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 130px;
}

.autodismiss-group select:hover {
    border-color: rgba(160, 82, 45, 0.4);
    background: rgba(160, 82, 45, 0.02);
}

.autodismiss-group select:focus {
    outline: none;
    border-color: #A0522D;
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
}

@media (max-width: 768px) {
    .sound-group,
    .autodismiss-group {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .sound-group select,
    .autodismiss-group select {
        flex: 1;
        min-width: 100px;
    }
}

/* Risk Settings Container - Separate Row */
.risk-settings-container {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    flex-wrap: wrap;
}

/* Risk Settings Group - Balance and Risk Percentage Controls */
.risk-settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(160, 82, 45, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(160, 82, 45, 0.1);
    min-width: 300px;
    max-width: 400px;
}

.risk-settings-title {
    font-size: 13px;
    font-weight: 700;
    color: #A0522D;
    text-align: center;
    margin-bottom: 4px;
}

.risk-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.risk-label {
    font-size: 13px;
    font-weight: 600;
    color: #A0522D;
    white-space: nowrap;
}

.risk-input-row input[type="number"] {
    background: white;
    color: #A0522D;
    border: 1px solid rgba(160, 82, 45, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 16px; /* 16px prevents iOS zoom */
    font-weight: 600;
    transition: all 0.3s ease;
    width: 130px;
    text-align: right;
    -moz-appearance: textfield; /* Remove spinner in Firefox */
}

/* Remove spinner arrows in Chrome, Safari, Edge, Opera */
.risk-input-row input[type="number"]::-webkit-outer-spin-button,
.risk-input-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.risk-input-row input[type="number"]:hover {
    border-color: rgba(160, 82, 45, 0.4);
    background: rgba(160, 82, 45, 0.02);
}

.risk-input-row input[type="number"]:focus {
    outline: none;
    border-color: #A0522D;
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
}

.apply-risk-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: rgba(23, 162, 184, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.apply-risk-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* Highlight state when changes need to be applied */
.apply-risk-btn.needs-apply {
    background: #ff9d5c;
    color: white;
    box-shadow: 0 2px 4px rgba(255, 157, 92, 0.3);
}

.apply-risk-btn.needs-apply:hover {
    background: #ff8c42;
    box-shadow: 0 4px 8px rgba(255, 140, 66, 0.4);
    transform: translateY(-2px) scale(1.02);
}

.apply-risk-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .risk-settings-container {
        padding: 0 16px;
    }

    .risk-settings-group {
        width: 100%;
        min-width: unset;
        max-width: unset;
    }

    .risk-input-row {
        flex-wrap: nowrap;
    }

    .risk-input-row input[type="number"] {
        flex: 1;
        min-width: 100px;
        width: auto;
    }
}

/* Pair Filter Button */
.pair-filter-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: rgba(23, 162, 184, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.pair-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

.pair-filter-btn:active {
    transform: translateY(0);
}

/* Display Filter Toggle - appears under Select Pairs button */
.display-filter-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(23, 162, 184, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(23, 162, 184, 0.1);
    margin-top: 8px;
}

.display-filter-toggle .toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: #A0522D;
    white-space: nowrap;
    user-select: none;
}

/* Pair Selector Modal */
.pair-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.pair-modal.show {
    display: flex !important;
}

.pair-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.pair-modal-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border: 3px solid #17a2b8;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(23, 162, 184, 0.4);
    animation: slideUp 0.4s ease;
}

.pair-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 2px solid rgba(23, 162, 184, 0.15);
}

.pair-modal-title {
    font-size: 28px;
    font-weight: 800;
    color: #17a2b8;
    letter-spacing: -0.5px;
    margin: 0;
}

.pair-modal-close {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(220, 53, 69, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.pair-modal-close:hover {
    background: #dc3545;
    color: white;
    transform: rotate(90deg);
}

.pair-modal-body {
    padding: 24px 32px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pair-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.pair-action-btn {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(23, 162, 184, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.pair-action-btn:hover {
    background: rgba(23, 162, 184, 0.2);
    transform: translateY(-2px);
}

/* Pair Display Filter - Hide unselected pairs toggle */
.pair-display-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(23, 162, 184, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(23, 162, 184, 0.1);
    margin-bottom: 16px;
}

.pair-display-filter .toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #A0522D;
}

.pair-search {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.pair-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(23, 162, 184, 0.2);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
    color: #17a2b8;
}

.pair-search input:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
}

.pairs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.pair-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(23, 162, 184, 0.05);
    border: 1px solid rgba(23, 162, 184, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(23, 162, 184, 0.1);
    touch-action: manipulation;
    user-select: none;
    position: relative;
}

.pair-item:hover {
    background: rgba(23, 162, 184, 0.1);
    border-color: rgba(23, 162, 184, 0.3);
}

.pair-item.selected {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
}

/* Hide default checkbox */
.pair-item input[type="checkbox"] {
    display: none;
}

/* Custom checkbox */
.pair-item::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(23, 162, 184, 0.3);
    border-radius: 4px;
    background: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Checkmark for selected items */
.pair-item.selected::before {
    background: white;
    border-color: white;
}

.pair-item.selected::after {
    content: '✓';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: black;
    font-size: 16px;
    font-weight: 900;
    pointer-events: none;
}

.pair-item label {
    font-size: 13px;
    font-weight: 600;
    color: #17a2b8;
    cursor: pointer;
    flex: 1;
    pointer-events: none; /* Prevent direct interaction, let parent div handle clicks */
}

.pair-item.selected label {
    color: white !important;
}

.pair-modal-footer {
    padding: 20px 32px;
    border-top: 2px solid rgba(23, 162, 184, 0.15);
}

.pair-save-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: rgba(23, 162, 184, 0.2);
    touch-action: manipulation;
    user-select: none;
}

.pair-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.4);
}

.pair-save-btn:active {
    transform: translateY(0);
}

/* Orange highlight when changes need to be saved */
.pair-save-btn.needs-save {
    background: #ff8c42;
    box-shadow: 0 2px 4px rgba(255, 140, 66, 0.3);
}

@media (max-width: 768px) {
    .pair-modal-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .pair-modal-header,
    .pair-modal-body,
    .pair-modal-footer {
        padding: 20px;
    }

    .pair-modal-title {
        font-size: 22px;
    }

    .pairs-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

/* Audio Unlock Modal */
.audio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    -webkit-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* When modal is shown (via JavaScript) */
.audio-modal.show {
    display: flex !important;
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.audio-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1;
}

.audio-modal-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #ffffff 0%, #FFF9F0 100%);
    border: 3px solid #A0522D;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(160, 82, 45, 0.4);
    -webkit-animation: slideUp 0.4s ease;
    animation: slideUp 0.4s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

@-webkit-keyframes slideUp {
    from {
        -webkit-transform: translateY(50px);
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        -webkit-transform: translateY(50px);
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        opacity: 1;
    }
}

.audio-modal-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

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

.audio-modal-title {
    font-size: 32px;
    font-weight: 800;
    color: #A0522D;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.audio-modal-text {
    font-size: 18px;
    color: rgba(160, 82, 45, 0.8);
    margin-bottom: 32px;
    line-height: 1.6;
}

.audio-enable-btn {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    color: white;
    border: none;
    padding: 18px 48px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(160, 82, 45, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    -webkit-tap-highlight-color: rgba(139, 69, 19, 0.3);
    touch-action: manipulation;
    user-select: none;
}

.audio-enable-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(160, 82, 45, 0.5);
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
}

.audio-enable-btn:active {
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 24px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.audio-modal-note {
    font-size: 14px;
    color: rgba(160, 82, 45, 0.6);
    margin-top: 24px;
    font-style: italic;
}

@media (max-width: 768px) {
    .audio-modal-content {
        padding: 36px 24px;
    }

    .audio-modal-icon {
        font-size: 56px;
    }

    .audio-modal-title {
        font-size: 26px;
    }

    .audio-modal-text {
        font-size: 16px;
    }

    .audio-enable-btn {
        padding: 16px 36px;
        font-size: 18px;
    }
}

/* Section Headers for Active/Closed Signals */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(160, 82, 45, 0.1);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c1810;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-count {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

#liveSignalsSection {
    margin-bottom: 48px;
}

#closedSignalsSection {
    margin-top: 48px;
}

#closedSignalsGrid .signal-card {
    opacity: 0.85;
    border-left: 4px solid #dc3545;
}

#closedSignalsGrid .signal-card:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .section-header {
        padding: 16px 0;
        margin-bottom: 16px;
    }

    .section-title {
        font-size: 20px;
    }

    .section-count {
        padding: 6px 16px;
        font-size: 14px;
    }

    #liveSignalsSection {
        margin-bottom: 32px;
    }

    #closedSignalsSection {
        margin-top: 32px;
    }

    /* Compact Active Positions box height on mobile/PWA - keep margins original */
    #liveSectionHeader {
        padding: 8px 16px !important;
    }

    #liveSectionHeader span {
        font-size: 12px !important;
    }

    #liveSignalsCount {
        font-size: 14px !important;
    }
}

/* Message Signal Styling - Premium Admin Message Card */
.signal-card.signal-message {
    background: linear-gradient(145deg, #ffffff 0%, #FFF9F0 50%, #FFF5E8 100%);
    border: 2px solid rgba(160, 82, 45, 0.18);
    position: relative;
    box-shadow: 0 4px 20px rgba(160, 82, 45, 0.08);
}

.signal-card.signal-message::before {
    background: linear-gradient(90deg, #A0522D 0%, #CD853F 50%, #DAA520 100%);
    height: 5px;
}

.signal-card.signal-message::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.4) 50%, transparent 100%);
}

.signal-card.signal-message:hover {
    border-color: rgba(160, 82, 45, 0.3);
    box-shadow: 0 8px 32px rgba(160, 82, 45, 0.15);
    transform: translateY(-2px);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(160, 82, 45, 0.1);
}

.message-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #A0522D 0%, #CD853F 50%, #DAA520 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(160, 82, 45, 0.3);
}

.message-subject {
    font-size: 20px;
    font-weight: 700;
    color: #5D4037;
    flex: 1;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.message-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #A0522D 0%, #CD853F 50%, #DAA520 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(160, 82, 45, 0.25);
}

.message-content {
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.04) 0%, rgba(212, 175, 55, 0.04) 100%);
    border: 1px solid rgba(160, 82, 45, 0.08);
    border-radius: 14px;
    padding: 18px 22px;
    margin: 16px 0;
    font-size: 15px;
    line-height: 1.7;
    color: #4E342E;
    font-weight: 500;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
}

.message-content::before {
    content: '"';
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 40px;
    color: rgba(160, 82, 45, 0.1);
    font-family: Georgia, serif;
    line-height: 1;
}

.signal-card.signal-message .signal-time {
    color: #8B4513;
    font-weight: 600;
}

.signal-card.signal-message .signal-datetime {
    color: rgba(139, 69, 19, 0.6);
}

.signal-card.signal-message .signal-id {
    border-top-color: rgba(160, 82, 45, 0.1);
    color: rgba(139, 69, 19, 0.4);
}

@media (max-width: 768px) {
    .message-header {
        gap: 12px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .message-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
        border-radius: 10px;
    }

    .message-subject {
        font-size: 17px;
    }

    .message-badge {
        padding: 4px 10px;
        font-size: 10px;
    }

    .message-content {
        font-size: 14px;
        padding: 14px 16px;
        border-radius: 12px;
    }

    .message-content::before {
        font-size: 32px;
        top: 6px;
        left: 10px;
    }
}

/* Pair Statistics Display */
.pair-stats-container {
    margin: 16px 0;
    padding: 14px 16px;
    background: rgba(160, 82, 45, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(160, 82, 45, 0.1);
}

.pair-stats-loading {
    text-align: center;
    font-size: 12px;
    color: rgba(160, 82, 45, 0.5);
    font-style: italic;
}

.pair-stats-empty {
    text-align: center;
    font-size: 12px;
    color: rgba(160, 82, 45, 0.5);
    font-style: italic;
}

.pair-stats-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pair-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pair-stats-label {
    font-size: 12px;
    font-weight: 700;
    color: #A0522D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pair-stats-winrate {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.result-circles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.result-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: help;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.result-circle:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .pair-stats-container {
        padding: 12px 14px;
    }

    .pair-stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .result-circles {
        gap: 3px;
    }

    .result-circle {
        width: 12px;
        height: 12px;
    }
}

/* TP Progress Tracking Styles */
.tp-progress-container {
    margin: 16px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.08) 0%, rgba(40, 167, 69, 0.04) 100%);
    border-left: 4px solid #28a745;
    border-radius: 12px;
    animation: slideIn 0.4s ease;
}

.tp-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.tp-progress-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fresh-signal-badge {
    font-size: 11px;
    font-weight: 700;
    color: #ff6b35;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 107, 53, 0.08) 100%);
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.tracking-timer {
    font-size: 12px;
    font-weight: 600;
    color: rgba(160, 82, 45, 0.8);
    font-family: 'Courier New', monospace;
}

.tp-current-price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.current-price-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(160, 82, 45, 0.6);
    text-transform: uppercase;
}

.current-price-value {
    font-size: 16px;
    font-weight: 800;
    color: #A0522D;
    font-family: 'Courier New', monospace;
}

.price-refresh-timer {
    font-size: 10px;
    font-weight: 600;
    color: rgba(160, 82, 45, 0.5);
    margin-left: 6px;
    padding: 2px 6px;
    background: rgba(160, 82, 45, 0.08);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

.tp-progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(160, 82, 45, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.tp-progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease, background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tp-progress-text {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-top: 6px;
}

/* Animation for pulse effect on fresh badge */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Responsive adjustments for TP Progress */
@media (max-width: 768px) {
    .tp-progress-container {
        padding: 12px 14px;
        margin: 12px 0;
    }

    .tp-progress-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fresh-signal-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .tracking-timer {
        font-size: 11px;
    }

    .current-price-value {
        font-size: 14px;
    }

    .tp-progress-text {
        font-size: 14px;
    }
}

/* Remove gap below footer */
html, body {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Compact footer for dashboard page */
.footer {
    padding: 30px 40px !important;
    margin-top: 60px !important;
    margin-bottom: 0 !important;
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px)) !important;
}

.footer-logo {
    font-size: 22px !important;
    margin-bottom: 10px !important;
}

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

@media (max-width: 768px) {
    .footer {
        padding: 24px 20px !important;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
        margin-top: 40px !important;
    }

    .footer-logo {
        font-size: 20px !important;
        margin-bottom: 8px !important;
    }

    .footer-text {
        font-size: 12px !important;
    }
}

/* Hide footer on dashboard page */
.footer {
    display: none !important;
}

/* ===== ACTIVE HOURS SETTINGS ===== */
.active-hours-setting {
    border-bottom: none !important;
    padding-bottom: 8px !important;
}

.active-hours-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 0 16px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.time-inputs-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-input-group label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.luxury-time-input {
    padding: 10px 12px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    background: rgba(248, 250, 252, 0.5);
    transition: all 0.2s ease;
    width: 110px;
}

.luxury-time-input:hover {
    border-color: rgba(23, 162, 184, 0.4);
    background: rgba(248, 250, 252, 0.8);
}

.luxury-time-input:focus {
    outline: none;
    border-color: #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.1);
    background: #fff;
}

.time-separator {
    color: #94a3b8;
    font-size: 18px;
    margin-top: 18px;
}

.active-hours-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.active-hours-buttons .luxury-action-btn.success {
    flex: 1;
}

.active-hours-buttons .luxury-action-btn.reset {
    width: auto;
    min-width: auto;
    padding: 12px 16px;
    background: rgba(148, 163, 184, 0.1);
    border: 2px solid rgba(148, 163, 184, 0.3);
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.active-hours-buttons .luxury-action-btn.reset:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: rgba(148, 163, 184, 0.5);
    color: #475569;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .time-inputs-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .luxury-time-input {
        width: 100px;
    }

    .active-hours-buttons {
        flex-direction: row;
    }
}
