/* ============================================
   MAIN CSS - MT4/MT5 EA Platform
   ============================================ */

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --primary-bg: #EFF6FF;
    --success: #10B981;
    --success-bg: #DCFCE7;
    --warning: #D97706;
    --warning-bg: #FEF3C7;
    --error: #DC2626;
    --error-bg: #FEE2E2;
    --info: #0891B2;
    --info-bg: #CFFAFE;
    --bg-body: #F8FAFC;
    --bg-surface: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #059669; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { background: var(--border-light); }

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ============ CARDS ============ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

/* ============ TABLES ============ */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table th {
    background: var(--border-light);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.table tr:hover td {
    background: var(--border-light);
}

/* ============ BADGES ============ */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success { background: var(--success-bg); color: #16A34A; }
.badge-warning { background: var(--warning-bg); color: #D97706; }
.badge-error { background: var(--error-bg); color: #DC2626; }
.badge-info { background: var(--info-bg); color: #0891B2; }
.badge-muted { background: var(--border-light); color: var(--text-muted); }

/* ============ FORMS ============ */
.form-group { margin-bottom: 15px; }

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-error {
    color: var(--error);
    font-size: 13px;
    margin-top: 5px;
}

/* ============ ALERTS ============ */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

.alert-success { background: var(--success-bg); color: #16A34A; }
.alert-warning { background: var(--warning-bg); color: #D97706; }
.alert-error { background: var(--error-bg); color: #DC2626; }
.alert-info { background: var(--info-bg); color: #0891B2; }

/* ============ GRID ============ */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============ STATS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2em;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.empty-state h3 {
    margin: 15px 0 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
}

/* ============ DARK MODE ============ */
[data-theme="dark"] {
    --bg-body: #080D18;
    --bg-surface: #0F172A;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --border: #1E293B;
    --border-light: #172033;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}




/* ============================================
   PROFESSIONAL FOOTER
   ============================================ */
.ft-footer {
    background: linear-gradient(180deg, #0B1322 0%, #0F172A 100%);
    color: #CBD5E1;
    font-family: 'Shabnam', 'Segoe UI', Tahoma, sans-serif;
    position: relative;
    overflow: hidden;
    margin-top: 60px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.ft-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0891B2, #2563EB, #059669);
}

.ft-footer-grid-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37,99,235,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,99,235,.04) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 70%);
}

.ft-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 30px;
}

/* --- Top: About + Newsletter --- */
.ft-top {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 40px;
}

.ft-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ft-brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #0891B2, #2563EB);
    box-shadow: 0 8px 24px -6px rgba(37,99,235,.5);
}

.ft-brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -.02em;
}

.ft-brand-sub {
    font-size: 11px;
    color: #64748B;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ft-about {
    color: #94A3B8;
    font-size: 14px;
    line-height: 1.9;
    max-width: 500px;
    margin-bottom: 20px;
}

/* Social Icons */
.ft-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ft-social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    text-decoration: none;
    transition: all .3s ease;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    color: #94A3B8;
}

.ft-social-link:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,.1);
    color: #FFFFFF;
    border-color: rgba(255,255,255,.2);
    box-shadow: 0 8px 24px -6px rgba(0,0,0,.4);
}

.ft-social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Newsletter */
.ft-newsletter {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 24px;
}

.ft-newsletter-title {
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ft-newsletter-desc {
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 16px;
    line-height: 1.7;
}

.ft-newsletter-form {
    display: flex;
    gap: 10px;
}

.ft-newsletter-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    transition: border-color .3s;
}

.ft-newsletter-input::placeholder {
    color: #64748B;
}

.ft-newsletter-input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

.ft-newsletter-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    background: linear-gradient(135deg, #0891B2, #2563EB);
    box-shadow: 0 8px 24px -6px rgba(37,99,235,.5);
    transition: transform .3s, box-shadow .3s;
    white-space: nowrap;
}

.ft-newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -8px rgba(37,99,235,.6);
}

/* --- Main Links --- */
.ft-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 30px;
}

.ft-col-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #FFFFFF;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ft-col-title::before {
    content: "";
    width: 3px;
    height: 16px;
    border-radius: 99px;
    background: linear-gradient(180deg, #0891B2, #2563EB);
}

.ft-col-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ft-col-links a {
    color: #94A3B8;
    text-decoration: none;
    font-size: 13.5px;
    transition: color .25s, padding-inline-start .25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ft-col-links a::before {
    content: "›";
    color: #475569;
    font-weight: 700;
    transition: color .25s;
}

.ft-col-links a:hover {
    color: #FFFFFF;
    padding-inline-start: 4px;
}

.ft-col-links a:hover::before {
    color: #67E8F9;
}

/* --- Bottom --- */
.ft-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12.5px;
    color: #64748B;
}

.ft-bottom-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.ft-bottom-links a {
    color: #64748B;
    text-decoration: none;
    transition: color .25s;
    font-size: 12.5px;
}

.ft-bottom-links a:hover {
    color: #CBD5E1;
}

.ft-risk {
    margin-top: 20px;
    padding: 16px 20px;
    background: rgba(220, 38, 38, .06);
    border: 1px solid rgba(220, 38, 38, .15);
    border-radius: 12px;
    font-size: 11.5px;
    color: #94A3B8;
    line-height: 1.9;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .ft-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .ft-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .ft-links-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .ft-newsletter-form {
        flex-direction: column;
    }
    .ft-newsletter-btn {
        width: 100%;
        justify-content: center;
    }
    .ft-bottom {
        flex-direction: column;
        text-align: center;
    }
    .ft-bottom-links {
        justify-content: center;
    }
}


/* ============ ADMIN DROPDOWN (Header) ============ */
.db-dropdown {
    position: relative;
    display: inline-block;
}

.db-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: #475569;
    padding: 8px 12px;
}

.db-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.db-dropdown.db-open .db-dropdown-arrow {
    transform: rotate(180deg);
}

.db-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
    padding: 8px;
}

.db-dropdown.db-open .db-dropdown-menu {
    display: block;
}

.db-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #475569;
    font-size: 13px;
    border-radius: 6px;
}

.db-dropdown-menu a:hover {
    background: #F1F5F9;
    color: #2563EB;
}