/* Custom CSS for TradePro Bot */

/* Signal Waves Animation */
.signal-waves {
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.signal-waves::before,
.signal-waves::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #10b981;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: wave 2s infinite;
}

.signal-waves::after {
    animation-delay: 0.5s;
}

@keyframes wave {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Signal Indicator */
.signal-indicator {
    position: relative;
    width: 16px;
    height: 16px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: 0.4s;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, #10b981, #059669);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Hover effects for cards */
.bg-gray-800 {
    transition: all 0.3s ease;
}

.bg-gray-800:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Table hover effects */
.hover\:bg-gray-750:hover {
    background-color: #374151;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Gradient backgrounds */
.bg-gradient-to-br {
    background: linear-gradient(135deg, #374151, #4b5563);
}

/* Animation for status dots */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom focus styles */
.toggle-switch input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .grid-cols-1.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-cols-1.lg\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .flex.items-center.space-x-6 {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    /* Mobile menu improvements */
    #mobile-menu {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    #mobile-menu .bg-gray-800 {
        background: rgba(31, 41, 55, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* Mobile button improvements */
    #mobile-menu-toggle {
        transition: all 0.3s ease;
    }
    
    #mobile-menu-toggle:hover {
        transform: scale(1.1);
    }
    
    #mobile-menu-close {
        transition: all 0.3s ease;
    }
    
    #mobile-menu-close:hover {
        transform: scale(1.1);
    }
    
    /* Mobile menu animations */
    #mobile-menu {
        animation: slideInFromRight 0.3s ease-out;
    }
    
    @keyframes slideInFromRight {
        from {
            transform: translateX(100%);
        }
        to {
            transform: translateX(0);
        }
    }
    
    /* Mobile control panel improvements */
    .control-panel input[type="number"],
    .control-panel input[type="text"],
    .control-panel select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile table improvements */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile card improvements */
    .bg-gray-800 {
        margin-bottom: 1rem;
    }
}

/* Loading animation for data */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Status indicators */
.status-online {
    background: linear-gradient(135deg, #10b981, #059669);
}

.status-offline {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.status-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Card shadows */
.card-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Text gradients */
.text-gradient {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Border animations */
.border-animated {
    position: relative;
    overflow: hidden;
}

.border-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    animation: border-slide 3s infinite;
}

@keyframes border-slide {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Custom slider styling */
.slider-custom {
    background: linear-gradient(to right, #374151 0%, #374151 70%, #10b981 70%, #10b981 100%);
}

.slider-custom::-webkit-slider-thumb {
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.slider-custom::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.slider-custom::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.slider-custom::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Input focus animations */
input:focus, select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Control panel animations */
#control-panel-toggle {
    position: relative;
    overflow: hidden;
}

#control-panel-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transition: left 0.5s ease;
}

#control-panel-toggle:hover::before {
    left: 100%;
}

/* Settings saved animation */
.settings-saved {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Input validation styles */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

/* Card hover effects for control panel */
.bg-gray-750 {
    transition: all 0.3s ease;
}

.bg-gray-750:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #4b5563;
}

/* Control Panel Styles */
.control-panel input[type="number"],
.control-panel input[type="text"],
.control-panel select {
    background-color: #374151;
    border: 1px solid #4b5563;
    color: #e5e7eb;
    transition: all 0.3s ease;
}

.control-panel input[type="number"]:focus,
.control-panel input[type="text"]:focus,
.control-panel select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    outline: none;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: #374151;
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #059669;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #059669;
    transform: scale(1.1);
}

/* Checkbox styling */
input[type="checkbox"] {
    accent-color: #10b981;
}

/* Activity log scrollable area */
.activity-log-scroll {
    scrollbar-width: thin;
    scrollbar-color: #6b7280 #374151;
}

.activity-log-scroll::-webkit-scrollbar {
    width: 6px;
}

.activity-log-scroll::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 3px;
}

.activity-log-scroll::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.activity-log-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Control panel sections */
.control-section {
    background: linear-gradient(135deg, #374151, #4b5563);
    border: 1px solid #4b5563;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.control-section:hover {
    border-color: #6b7280;
    transform: translateY(-1px);
}

/* Save button animation */
#save-settings {
    position: relative;
    overflow: hidden;
}

#save-settings::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#save-settings:hover::before {
    left: 100%;
}

/* Input validation styles */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Settings saved notification */
.settings-saved {
    animation: settingsSaved 0.6s ease-in-out;
}

@keyframes settingsSaved {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}
