:root {
    /* Colors */
    --bg-dark: #0f1115;
    --bg-panel: rgba(26, 29, 36, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Vinted Brand Accent but modernized */
    --accent: #05acc7;
    --accent-hover: #0492a9;
    --accent-glow: rgba(5, 172, 199, 0.4);
    
    /* Status Colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #05acc7 0%, #3b82f6 100%);
    
    /* Effects */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-glass: blur(12px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Background Animated Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s ease-in-out infinite;
}

.blob-1 {
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--accent-glow);
}

.blob-2 {
    bottom: -150px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: rgba(59, 130, 246, 0.2);
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
    padding: 2rem;
    gap: 2rem;
    max-width: 1440px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-glass);
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    animation: pulseLogo 3s infinite;
}

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

nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

nav a {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 0.875rem 1rem !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    transition: var(--transition) !important;
    border-left: 4px solid transparent !important;
}

nav a:visited {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

nav a.active {
    background: rgba(5, 172, 199, 0.1) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    border-left-color: var(--accent) !important;
    text-decoration: none !important;
}

nav a.text-danger {
    color: var(--danger) !important;
}

nav a.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.nav-icon {
    font-size: 1.25rem;
}

.bot-status-card {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-glass);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
}

.dot.stopped {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger-glow);
}

.pulse {
    animation: pulseDot 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.primary {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn.primary:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 20px var(--danger-glow);
    transform: translateY(-2px);
}

.btn.primary.start {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: var(--success);
}

.btn.primary.start:hover {
    background: var(--success);
    color: white;
    box-shadow: 0 0 20px var(--success-glow);
}

.btn.submit-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
    margin-top: 1rem;
}

.btn.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 8px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Main Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header p {
    color: var(--text-secondary);
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Form Styles */
.form-panel form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(5, 172, 199, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

/* Tooltips */
.tooltip-container {
    position: relative;
}

.info-icon {
    font-size: 0.8rem;
    cursor: help;
    opacity: 0.7;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: white;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 10;
    white-space: nowrap;
    border: 1px solid var(--border-glass);
}

.tooltip-container:hover .tooltip {
    opacity: 1;
    transform: translateY(-5px);
}

/* Terminal Logs Section */
.logs-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal {
    background: #000;
    border-radius: 12px;
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    position: relative;
}

.terminal::-webkit-scrollbar {
    width: 6px;
}

.terminal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.terminal-content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.log-line {
    word-break: break-all;
    line-height: 1.4;
}

.log-line.text-muted { color: #6b7280; }
.log-line.text-info { color: #3b82f6; }
.log-line.text-success { color: #10b981; }
.log-line.text-danger { color: #ef4444; }
.log-line.text-warning { color: #f59e0b; }

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-panel);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items:flex-start;
    gap: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast-indicator {
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--success);
    border-radius: 12px 0 0 12px;
}

.toast-content h4 {
    margin-bottom: 0.2rem;
    font-size: 1rem;
}

.toast-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Utilities */
.hidden { display: none !important; }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .input-row {
        grid-template-columns: 1fr;
    }
}

/* --- NEW ADVANCED UI STYLES --- */

/* Login Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 17, 21, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-card {
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.brand.center {
    justify-content: center;
    margin-bottom: 0.5rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Searches Grid */
.searches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.search-card {
    background: var(--bg-panel);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.search-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.search-card.active-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.search-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    padding-right: 3rem;
}

.search-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.running {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-badge.stopped {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

/* Chart Container */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Utilities */
.mt-2 { margin-top: 2rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.text-danger { color: var(--danger); }
.small { padding: 0.5rem 1rem; font-size: 0.85rem; border-radius: 8px;}

/* Alarm Controls Bar */
.alarm-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
}

.mini-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
}

.mini-toggle span {
    opacity: 0.8;
}

.toggle-switch.small {
    width: 32px;
    height: 18px;
}

.toggle-switch.small .slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch.small input:checked + .slider:before {
    transform: translateX(14px);
}

 / *   S e a r c h   C a r d   M e t a   * / 
 . c a r d - m e t a   { 
         m a r g i n - b o t t o m :   1 r e m ; 
         d i s p l a y :   f l e x ; 
         f l e x - d i r e c t i o n :   c o l u m n ; 
         g a p :   0 . 2 5 r e m ; 
 } 
 
 . u r l - b a d g e   { 
         f o n t - s i z e :   0 . 7 r e m ; 
         b a c k g r o u n d :   r g b a ( 5 ,   1 7 2 ,   1 9 9 ,   0 . 1 5 ) ; 
         c o l o r :   # 4 e d 9 e e ; 
         p a d d i n g :   0 . 2 r e m   0 . 5 r e m ; 
         b o r d e r - r a d i u s :   4 p x ; 
         a l i g n - s e l f :   f l e x - s t a r t ; 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         g a p :   0 . 4 r e m ; 
         m a x - w i d t h :   1 0 0 % ; 
         w h i t e - s p a c e :   n o w r a p ; 
         o v e r f l o w :   h i d d e n ; 
         t e x t - o v e r f l o w :   e l l i p s i s ; 
 }  
 