/* ========================================================================= 
   ✨ Century Pro Injector - Ultra Premium Sidebar Glassmorphism Theme ✨
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Dynamic Dark/Space Colors */
    --body-bg-1: #050b14;
    --body-bg-2: #0f172a;
    
    /* Sidebar */
    --sidebar-bg: rgba(11, 15, 25, 0.85);
    --sidebar-border: rgba(255, 255, 255, 0.05);
    
    /* Glassmorphism Panels */
    --glass-bg: rgba(17, 24, 39, 0.55);
    --glass-bg-hover: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.12);
    
    /* Neon Accents */
    --accent: #00C9FF; /* Cyan Glow */
    --accent-hover: #00e5ff;
    --accent-glow: rgba(0, 201, 255, 0.5);
    
    --secondary-accent: #8b5cf6; /* Purple/Violet */
    --secondary-glow: rgba(139, 92, 246, 0.5);
    
    --danger: #ef4444;
    --danger-hover: #f87171;
    --danger-glow: rgba(239, 68, 68, 0.5);
    
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Typography */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Inputs */
    --input-bg: rgba(15, 23, 42, 0.7);
    --input-border: rgba(255, 255, 255, 0.1);
}

/* ==============================================
   Global Resets & Keyframes
   ============================================== */
* { 
    font-family: 'Inter', 'Outfit', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px var(--accent-glow); }
    50% { box-shadow: 0 0 25px var(--accent-glow); }
    100% { box-shadow: 0 0 10px var(--accent-glow); }
}

@keyframes pulseGlowDanger {
    0% { box-shadow: 0 0 10px var(--danger-glow); }
    50% { box-shadow: 0 0 25px var(--danger-glow); }
    100% { box-shadow: 0 0 10px var(--danger-glow); }
}

body { 
    background: linear-gradient(-45deg, var(--body-bg-1), var(--body-bg-2), #0b071c, #071520);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary); 
    direction: rtl; 
    height: 100vh;
    display: flex;
    overflow: hidden; 
    font-size: 14px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; letter-spacing: 0.5px; }

/* ==============================================
   Layout (Sidebar + Main)
   ============================================== */
#app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    z-index: 10;
    transition: all 0.3s ease;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 15px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #00C9FF, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,201,255,0.2);
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.sidebar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-btn:hover { 
    background: rgba(255,255,255,0.05); 
    color: var(--text-primary); 
    transform: translateX(-4px);
}

.sidebar-btn.active {
    background: linear-gradient(135deg, rgba(0,201,255,0.15), rgba(139,92,246,0.15));
    color: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.sidebar-btn .icon { font-size: 1.2rem; }
.sidebar-btn .close-farm {
    margin-right: auto;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    transition: 0.3s;
}
.sidebar-btn .close-farm:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 0 10px var(--danger-glow);
}

.add-farm-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px dashed var(--success);
    color: var(--success);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}
.add-farm-btn:hover {
    background: var(--success);
    color: white;
    border-style: solid;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* Main Content Area */
#main-content-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.farm-content, .main-tab-content, .vip-tab-content, .engine-tab-content { display: none; }
.farm-content.active, .main-tab-content.active, .vip-tab-content.active, .engine-tab-content.active { 
    display: block; 
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==============================================
   Glass Panels & Cards
   ============================================== */
.module-box, .control-group {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module-box:hover {
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.module-box h3, .control-group h2 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* VIP Cards Grid (Replacing old tabs) */
.vip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.vip-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.vip-card::before {
    content: ''; position: absolute; top: 0; right: 0; width: 4px; height: 100%;
    background: var(--accent); opacity: 0; transition: 0.3s;
}
.vip-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 5px 20px rgba(0,201,255,0.1); }
.vip-card:hover::before { opacity: 1; }

.vip-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 5px;
}
.vip-card-icon {
    font-size: 1.5rem;
    background: rgba(0,201,255,0.1);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
}

/* ==============================================
   Form Inputs & Elements
   ============================================== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.four-col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.input-field label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(0, 201, 255, 0.15), inset 0 2px 5px rgba(0,0,0,0.2);
}

/* Checkboxes */
.checkbox-group {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid var(--glass-border);
    cursor: pointer; transition: 0.3s;
}
.checkbox-group:hover { background: rgba(255,255,255,0.08); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ==============================================
   Buttons
   ============================================== */
.btn {
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    color: white;
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

.btn-primary { 
    background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%);
    border: none; text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn-primary:hover { box-shadow: 0 6px 20px var(--accent-glow); }

.btn-danger { background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%); border: none; }
.btn-danger:hover { box-shadow: 0 6px 20px var(--danger-glow); }

.btn-success { background: linear-gradient(135deg, var(--success) 0%, #059669 100%); border: none; }
.btn-success:hover { box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }

.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: rgba(0,201,255,0.1); box-shadow: 0 0 15px var(--accent-glow); }

/* Animations for Status */
.start-main { animation: pulseGlow 3s infinite; }
.stop-main { animation: pulseGlowDanger 2s infinite; }

/* ==============================================
   Farm View Structure (Flex Row for Settings & Terminal)
   ============================================== */
.farm-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 40px);
}

.farm-settings-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px; /* for scrollbar */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.farm-terminal-container {
    flex: 0 0 340px;
    background: rgba(5, 11, 20, 0.6);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
}

.terminal-header {
    background: rgba(0,0,0,0.5);
    padding: 12px 15px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.farm-terminal-window {
    flex: 1;
    background: transparent !important;
    color: #4ade80 !important; /* Hacker green */
    padding: 15px !important;
    font-family: 'JetBrains Mono', 'Consolas', monospace !important;
    font-size: 11.5px !important;
    line-height: 1.6 !important; 
    overflow-y: auto;
    white-space: pre-wrap !important; 
    word-break: break-word !important; 
    border: none !important;
}

/* ==============================================
   Queue Table
   ============================================== */
.queue-table-wrapper { padding: 0; overflow: hidden; border-radius: 12px; background: rgba(0,0,0,0.2); }
.queue-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s;
    background: rgba(255,255,255,0.01);
}
.queue-item:hover { background: rgba(255,255,255,0.05); transform: translateX(-4px); }

/* ==============================================
   Login Overlay
   ============================================== */
#login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(5, 11, 20, 0.95), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(15px);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.login-box {
    width: 440px; padding: 40px; background: var(--glass-bg);
    border: 1px solid var(--glass-highlight); border-radius: 24px;
    text-align: center; display: flex; flex-direction: column; gap: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 50px var(--secondary-glow);
    animation: floatIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.login-box h1 { font-size: 2.6rem; font-weight: 800; background: linear-gradient(to right, #00C9FF, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ==============================================
   Misc Elements & Utilities
   ============================================== */
.hidden { display: none !important; }
hr.fancy-hr { border: 0; height: 1px; background: linear-gradient(to right, transparent, var(--glass-border), transparent); margin: 25px 0; }

.pro-progress-container {
    width: 100%; background: rgba(0,0,0,0.4); border-radius: 10px; overflow: hidden; height: 44px;
    position: relative; box-shadow: inset 0 2px 10px rgba(0,0,0,0.5); display: none;
    border: 1px solid var(--glass-border);
}
.pro-progress-bar {
    height: 100%; background: linear-gradient(90deg, #00C9FF 0%, #8b5cf6 50%, #ec4899 100%); background-size: 200% 200%;
    animation: gradientShift 3s ease infinite; width: 100%; border-radius: 10px; transition: width 0.4s; box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}
.pro-progress-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: white; font-size: 0.9rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,0.8); pointer-events: none;
}

/* Helper Classes */
.text-center { text-align: center; } .text-accent { color: var(--accent); } .text-muted { color: var(--text-muted); } .text-danger { color: var(--danger); }
.w-full { width: 100%; } .mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 15px; } .mt-3 { margin-top: 15px; }
.font-bold { font-weight: bold; } .text-xl { font-size: 1.3rem; } .text-lg { font-size: 1.15rem; }

/* Grid helper classes in case they are not defined elsewhere */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.gap-4 { gap: 15px; }

/* ========================================================================= 
   📱 Mobile Responsive Styles (Screens up to 768px)
   ========================================================================= */
@media (max-width: 768px) {
    body {
        flex-direction: column !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
    }
    
    #app-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
    }
    
    /* Responsive Horizontal Sidebar Navigation */
    .sidebar {
        width: 100% !important;
        height: auto !important;
        border-left: none !important;
        border-bottom: 1px solid var(--sidebar-border) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
        padding: 12px 15px !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .sidebar-header {
        padding-bottom: 8px !important;
        margin-bottom: 8px !important;
        text-align: center !important;
    }
    
    .sidebar-header h2 {
        font-size: 1.3rem !important;
    }
    
    .sidebar-menu {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        padding-bottom: 5px !important;
        gap: 8px !important;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    
    .sidebar-menu::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }
    
    .sidebar-btn {
        display: inline-flex !important;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        gap: 6px !important;
    }
    
    .sidebar-btn:hover {
        transform: none !important;
    }
    
    .add-farm-btn {
        margin-top: 0 !important;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        width: 100% !important;
    }
    
    /* Responsive Content Area */
    #main-content-area {
        padding: 12px !important;
        width: 100% !important;
        overflow-y: visible !important;
    }
    
    .module-box, .control-group {
        padding: 15px !important;
        margin-bottom: 15px !important;
        border-radius: 12px !important;
    }
    
    /* Farm View Mobile Stack Layout */
    .farm-layout {
        flex-direction: column-reverse !important; /* Shows settings first, then terminal/logs below */
        height: auto !important;
        gap: 15px !important;
    }
    
    .farm-settings-area {
        overflow-y: visible !important;
        padding-right: 0 !important;
        width: 100% !important;
    }
    
    .farm-terminal-container {
        flex: none !important;
        width: 100% !important;
        height: 300px !important; /* Constrained height for live logs on mobile */
        border-radius: 12px !important;
    }
    
    .farm-terminal-window {
        font-size: 10.5px !important;
        padding: 10px !important;
    }
    
    /* Stack Grid layouts to a single column on Mobile */
    .two-col, .three-col, .four-col, .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .vip-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Login Overlay Mobile responsive */
    .login-box {
        width: calc(100% - 30px) !important;
        max-width: 380px !important;
        padding: 25px 20px !important;
        border-radius: 16px !important;
        margin: 15px !important;
    }
    
    .login-box h1 {
        font-size: 2rem !important;
    }
}
