/* Cactus Flasher - Dark Theme Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Tab buttons */
.tab-btn {
    color: #9ca3af;
}

.tab-btn:hover {
    color: #e5e7eb;
    background-color: #374151;
}

.tab-btn.active {
    color: #22c55e;
    background-color: #374151;
}

/* Project type buttons */
.project-type-btn {
    color: #9ca3af;
    background-color: transparent;
}

.project-type-btn:hover {
    color: #e5e7eb;
    background-color: #374151;
}

.project-type-btn.active {
    color: #22c55e;
    background-color: #374151;
    border-color: #22c55e;
}

/* Board cards */
.board-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Status indicator */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.status-indicator.offline {
    background-color: #ef4444;
    animation: none;
}

.status-indicator.checking {
    background-color: #f59e0b;
    animation: pulse 1s infinite;
}

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

/* Drop zone */
#drop-zone.drag-over {
    border-color: #22c55e;
    background-color: rgba(34, 197, 94, 0.1);
}

/* Console output (shared by boards and flash consoles) */
.console-panel {
    font-family: 'Courier New', Courier, monospace;
}

.console-panel .log-info {
    color: #60a5fa;
}

.console-panel .log-success {
    color: #22c55e;
}

.console-panel .log-error {
    color: #ef4444;
}

.console-panel .log-warning {
    color: #f59e0b;
}

/* Progress bar animation */
#progress-bar {
    transition: width 0.3s ease-out;
}

/* Build status badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending {
    background-color: #374151;
    color: #9ca3af;
}

.badge-building {
    background-color: #1e3a5f;
    color: #60a5fa;
}

.badge-success {
    background-color: #14532d;
    color: #22c55e;
}

.badge-failed {
    background-color: #7f1d1d;
    color: #ef4444;
}

/* Status log badges */
.badge-online {
    background-color: #14532d;
    color: #22c55e;
}

.badge-offline {
    background-color: #7f1d1d;
    color: #ef4444;
}

/* Port badges */
.port-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
}

.port-badge.web {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.port-badge.ota {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.port-badge.api {
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Loading spinner */
.spinner {
    border: 2px solid #374151;
    border-top: 2px solid #22c55e;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background-color: #1f2937;
    border: 1px solid #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-color: #22c55e;
}

.toast.error {
    border-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form inputs focus state */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* Button disabled state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Tooltip System ==================== */

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-wrapper .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 50;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.tooltip-wrapper .tooltip-text.tooltip-wide {
    white-space: normal;
    min-width: 220px;
    max-width: 300px;
    text-align: left;
}

.tooltip-wrapper .tooltip-text.tooltip-bottom {
    bottom: auto;
    top: calc(100% + 8px);
}

.tooltip-wrapper .tooltip-text.tooltip-bottom::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #374151;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Arrow pointing down (for top tooltip) */
.tooltip-wrapper .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #374151;
}

/* Guide section styles */
.guide-section h3 {
    color: #4ade80;
    margin-bottom: 0.5rem;
}

.guide-step {
    counter-increment: step-counter;
    position: relative;
    padding-left: 2.5rem;
}

.guide-step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background-color: #14532d;
    color: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.guide-steps {
    counter-reset: step-counter;
}

/* Sensor badge */
.sensor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    background-color: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .project-type-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}
