/* ============================================
   ADUG Global Investment Portal - Styles v2
   ============================================ */

:root {
    --primary: #0f172a;
    --secondary: #1e40af;
    --accent: #3b82f6;
    --gold: #facc15;
    --gold-dark: #eab308;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #1e40af; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #facc15; }

html { scroll-behavior: smooth; }

/* ---- Glassmorphism ---- */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
}

/* ---- Hero Grid ---- */
.hero-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDelay {
    0% { opacity: 0; transform: translateY(24px); }
    50% { opacity: 0; }
    100% { opacity: 1; transform: translateY(0); }
}

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

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

.animate-fade-in { animation: fadeIn 0.7s ease-out forwards; }
.animate-fade-in-delay { animation: fadeInDelay 1s ease-out forwards; }
.animate-slide-in { animation: slideInRight 0.4s ease-out forwards; }

/* ---- Nav ---- */
.nav-scrolled {
    background: rgba(15, 23, 42, 0.92) !important;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* ---- Form Inputs ---- */
.form-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    outline: none;
    transition: all 0.3s;
}

.form-input::placeholder { color: rgba(255,255,255,0.3); }

.form-input:focus {
    border-color: #facc15;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.1);
}

.form-input.border-red-500 { border-color: #ef4444 !important; }

.form-input option { background: #0f172a; color: white; }

select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }

/* ---- Step Progress ---- */
.step-circle.active { border-color: #facc15 !important; background: #facc15 !important; color: #0f172a !important; }
.step-circle.completed { border-color: #22c55e !important; background: #22c55e !important; color: white !important; }
.step-label.active { color: #facc15 !important; }
.step-line.completed { background: #22c55e !important; }

/* ---- File Upload ---- */
.file-upload-zone { transition: all 0.3s; }
.file-upload-zone.dragover { border-color: #facc15 !important; background: rgba(250, 204, 21, 0.05); }
.file-upload-zone.has-file { border-color: #22c55e !important; background: rgba(34, 197, 94, 0.05); }

/* ---- Loading Spinner ---- */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---- Toast Notifications ---- */
.toast {
    animation: slideInRight 0.4s ease-out forwards;
    min-width: 300px;
    max-width: 420px;
}

.toast-success { background: rgba(34, 197, 94, 0.95); border-left: 4px solid #16a34a; }
.toast-error { background: rgba(239, 68, 68, 0.95); border-left: 4px solid #dc2626; }
.toast-info { background: rgba(59, 130, 246, 0.95); border-left: 4px solid #2563eb; }
.toast-warning { background: rgba(245, 158, 11, 0.95); border-left: 4px solid #d97706; }

/* ---- Admin table ---- */
@media (max-width: 768px) {
    table { font-size: 0.8rem; }
    th, td { padding: 8px 12px !important; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .hero-grid { background-size: 40px 40px; }
}

@media (max-width: 768px) {
    table { font-size: 0.8rem; }
    th, td { padding: 8px 12px !important; }
    .step-indicator .step-label { display: none !important; }
    /* Prevent horizontal scroll on mobile */
    body { overflow-x: hidden; max-width: 100vw; }
    /* Improve touch targets */
    button, a[role="button"], .nav-link, .btn, form button[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 640px) {
    .step-indicator .step-label { display: none !important; }
    .hero-grid { background-size: 40px 40px; }
    /* Stack grid items on small screens */
    .grid { overflow-x: hidden; }
    img, svg, video, canvas { max-width: 100%; height: auto; }
    /* Ensure all interactive elements are clickable */
    input, select, textarea, button { font-size: 16px; }
    /* Fix overflow on glass cards */
    .glass-card { overflow-wrap: break-word; word-break: break-word; }
    /* Prevent form inputs from overflowing */
    .form-input { max-width: 100%; }
}

/* Mobile translation dropdown specific */
#langSelectorMobile {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Desktop language dropdown */
#langSelector {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    min-width: 130px;
}

/* RTL Support */
[dir="rtl"] #langSelector {
    background-position: left 8px center;
    padding-right: 12px;
    padding-left: 32px;
}
[dir="rtl"] #toastContainer {
    right: auto;
    left: 1.5rem;
}
[dir="rtl"] .step-line {
    margin-left: 0;
    margin-right: 0.5rem;
}
