/* Alarms Page - Apple Glassmorphism Design */

.alarms-container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

/* Glassmorphism Base */
.glass {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.glass-btn {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.8) 0%, rgba(6, 182, 212, 0.8) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow:
        0 4px 15px rgba(14, 165, 233, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 25px rgba(14, 165, 233, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.glass-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

/* Setup Flow Layout */
.setup-flow {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.step-card {
    flex: 1;
    min-width: 280px;
    max-width: 380px;
    padding: 25px;
    position: relative;
}

.step-number {
    position: absolute;
    top: -15px;
    left: 25px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.step-card h2 {
    margin: 15px 0 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #f8fafc);
}

/* Flow Arrow */
.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(14, 165, 233, 0.6);
    animation: pulse-arrow 2s ease-in-out infinite;
    padding: 0 10px;
    align-self: center;
}

@keyframes pulse-arrow {

    0%,
    100% {
        opacity: 0.5;
        transform: translateX(0);
    }

    50% {
        opacity: 1;
        transform: translateX(5px);
    }
}

/* Alert Options with Checkboxes */
.select-all-row {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 14px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s;
}

.checkbox-wrapper input:checked+.checkmark,
.alert-option input:checked+.checkmark {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border-color: transparent;
}

.checkbox-wrapper input:checked+.checkmark::after,
.alert-option input:checked+.checkmark::after {
    opacity: 1;
    transform: scale(1);
}

.alert-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
}

.alert-option input[type="checkbox"] {
    display: none;
}

.alert-option.selected {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
}

.alert-content {
    flex: 1;
}

.alert-option .title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary, #f8fafc);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.alert-option .desc {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.4;
}

/* Exchange Options */
.exchange-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 500;
}

.exchange-option.selected {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

.exchange-icon {
    font-size: 1.3rem;
}

/* Coin Options */
.coin-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 500;
}

.coin-option.selected {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
}

.coin-icon {
    font-size: 1.3rem;
}

/* Action Button */
.action-area {
    margin-top: 25px;
}

.btn-start {
    width: 100%;
    padding: 18px 25px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-start:disabled {
    background: rgba(100, 116, 139, 0.4);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* Monitoring View */
.monitoring-container {
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.monitoring-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.monitoring-header h2 {
    flex: 1;
    margin: 0;
    font-size: 1.3rem;
}

.pulse-dot {
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px #22c55e;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.btn-stop {
    padding: 12px 25px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8) 0%, rgba(220, 38, 38, 0.8) 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-stop:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.monitoring-info {
    padding: 20px;
    margin-bottom: 25px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-label {
    color: var(--text-secondary, #94a3b8);
}

.highlight {
    color: #0ea5e9;
    font-weight: 600;
}

/* Log Container */
.log-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
}

.log-entry {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-entry.system {
    border-left-color: #0ea5e9;
    color: #94a3b8;
}

.log-entry.alert {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.log-entry .time {
    color: #64748b;
    margin-right: 12px;
    font-size: 0.75rem;
}

.token-name {
    color: #0ea5e9;
    font-weight: 700;
}

.btn-add-chart {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-add-chart:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.5);
}

.btn-add-chart:disabled {
    background: #22c55e;
    cursor: default;
}

/* Responsive */
@media (max-width: 900px) {
    .setup-flow {
        flex-direction: column;
        align-items: center;
    }

    .flow-arrow {
        transform: rotate(90deg);
        padding: 15px 0;
    }


    /* Tooltip Styles */
    .title-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 4px;
    }
}

/* Tooltip Styles */
.tooltip-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    transition: all 0.2s;
    border: 1px solid rgba(14, 165, 233, 0.3);
    z-index: 10;
}

.tooltip-icon:hover {
    background: var(--accent-turbo);
    color: white;
    border-color: var(--accent-turbo);
    transform: scale(1.1);
}

/* Static tooltip popup (inside alert cards) */
.tooltip-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px;
    margin-top: 10px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.6;
}

.tooltip-popup.visible {
    display: block;
    animation: tooltipFadeIn 0.25s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip-header {
    font-weight: 700;
    color: #0ea5e9;
    margin-bottom: 10px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.tooltip-body ul {
    margin: 8px 0 12px 20px;
    padding: 0;
    list-style-type: disc;
    color: #e2e8f0;
}

.tooltip-body li {
    margin-bottom: 4px;
}

.tooltip-limit {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    margin-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

/* Parent must be relative for absolute popup positioning */
.alert-content {
    position: relative;
}

/* Raise z-index when tooltip is active */
.alert-option.active-tooltip {
    z-index: 200;
    position: relative;
}

.custom-tooltip {
    position: fixed;
    z-index: 2000;
    width: max-content;
    max-width: 350px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 0.85rem;
    line-height: 1.6;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    white-space: pre-wrap;
}

.custom-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.custom-tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: inherit;
    border-left: 1px solid rgba(14, 165, 233, 0.4);
    border-bottom: 1px solid rgba(14, 165, 233, 0.4);
    transform: rotate(-45deg);
    z-index: -1;
}

@media (max-width: 700px) {
    .custom-tooltip {
        max-width: 85vw;
        width: 85vw;
        left: 50% !important;
        transform: translate(-50%, 15px) scale(0.95);
    }

    .custom-tooltip.visible {
        transform: translate(-50%, 0) scale(1);
    }

    .custom-tooltip-arrow {
        display: none;
    }
}