/* ============================================
   VIYA BROKER V2 - PREMIUM MARITIME DESIGN
   ============================================ */

:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #E6F0FF;
    --gold: #D4A853;
    --gold-dark: #B8922E;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --black: #030712;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --container: 1280px;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-card: rgba(15, 23, 42, 0.6);
    --border-color: rgba(148, 163, 184, 0.2);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

/* Light mode support */
@media (prefers-color-scheme: light) {
    :root {
        --text-primary: #1e293b;
        --text-secondary: #64748b;
        --bg-card: rgba(255, 255, 255, 0.9);
        --border-color: rgba(148, 163, 184, 0.3);
    }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); font-size: 15px; line-height: 1.6; color: var(--gray-800); background: var(--white); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* Loader */
.loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--black); display: none; place-items: center; z-index: 9999; }
.loader-content { text-align: center; }
.loader-logo img { width: 80px; margin-bottom: 30px; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.loader-bar { width: 200px; height: 3px; background: var(--gray-800); border-radius: 3px; overflow: hidden; margin-bottom: 20px; }
.loader-progress { height: 100%; width: 30%; background: var(--primary); animation: loading 1.5s ease-in-out infinite; }
@keyframes loading { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }
.loader-text { color: var(--gray-400); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; }

/* Landing Nav */
.landing-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px); border-bottom: 1px solid var(--gray-200); }
.nav-container { max-width: var(--container); margin: 0 auto; padding: 0 24px; height: 72px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; color: var(--gray-900); }
.nav-logo img { height: 36px; }
.nav-menu { display: flex; gap: 32px; }
.nav-link { font-weight: 500; color: var(--gray-600); transition: var(--transition); position: relative; }
.nav-link:hover, .nav-link.active { color: var(--gray-900); }
.nav-link.active::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: var(--primary); border-radius: 2px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-select { padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 6px; background: var(--white); color: var(--gray-700); font-weight: 500; }
.btn-outline { padding: 10px 20px; border: 1px solid var(--gray-300); border-radius: 8px; font-weight: 600; color: var(--gray-700); transition: var(--transition); }
.btn-outline:hover { border-color: var(--gray-900); color: var(--gray-900); }
.btn-primary { padding: 10px 24px; background: var(--primary); border-radius: 8px; font-weight: 600; color: var(--white); transition: var(--transition); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.nav-toggle { display: none; font-size: 24px; color: var(--gray-700); }

/* Hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%); }
.hero-content { position: relative; z-index: 2; max-width: var(--container); margin: 0 auto; padding: 120px 24px; color: var(--white); }
.hero-badge { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); border-radius: 50px; font-size: 14px; margin-bottom: 32px; }
.hero-badge i { color: var(--gold); }
.hero-title { font-family: var(--font-display); font-size: clamp(40px, 6vw, 72px); font-weight: 600; line-height: 1.1; margin-bottom: 24px; }
.hero-title .highlight { color: var(--gold); }
.hero-subtitle { font-size: 18px; color: rgba(255,255,255,0.8); max-width: 540px; margin-bottom: 40px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; margin-bottom: 60px; }
.btn-hero-primary { display: inline-flex; align-items: center; gap: 10px; padding: 16px 32px; background: var(--primary); border-radius: 8px; font-weight: 600; color: var(--white); font-size: 16px; transition: var(--transition); }
.btn-hero-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 10px 40px rgba(0,102,255,0.3); }
.btn-hero-secondary { display: inline-flex; align-items: center; gap: 10px; padding: 16px 32px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.3); border-radius: 8px; font-weight: 600; color: var(--white); font-size: 16px; transition: var(--transition); }
.btn-hero-secondary:hover { background: rgba(255,255,255,0.2); }
.hero-stats { display: flex; align-items: center; gap: 40px; }
.stat-item { text-align: left; }
.stat-number { display: block; font-size: 32px; font-weight: 700; color: var(--white); }
.stat-label { font-size: 14px; color: rgba(255,255,255,0.6); }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,0.2); }
.hero-scroll { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); text-align: center; color: rgba(255,255,255,0.5); font-size: 13px; }
.scroll-line { width: 1px; height: 40px; background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent); margin: 10px auto 0; animation: scrollDown 2s ease-in-out infinite; }
@keyframes scrollDown { 0%, 100% { transform: scaleY(1); opacity: 1; } 50% { transform: scaleY(0.5); opacity: 0.5; } }

/* Trusted */
.trusted-section { padding: 40px 0; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.trusted-label { text-align: center; color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }
.trusted-logos { display: flex; justify-content: center; align-items: center; gap: 60px; flex-wrap: wrap; }
.logo-item { font-weight: 700; font-size: 18px; color: var(--gray-400); letter-spacing: 2px; }

/* Section Styles */
.section-tag { display: inline-block; padding: 6px 14px; background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 600; border-radius: 50px; margin-bottom: 16px; }
.section-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 42px); font-weight: 600; color: var(--gray-900); margin-bottom: 16px; }
.section-subtitle { font-size: 17px; color: var(--gray-500); max-width: 600px; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header .section-subtitle { margin: 0 auto; }
.section-header.light .section-title, .section-header.light .section-subtitle { color: var(--white); }
.section-header.light .section-tag { background: rgba(255,255,255,0.1); color: var(--white); }

/* About */
.about-section { padding: 120px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.about-image { position: relative; }
.about-image img { border-radius: 16px; box-shadow: var(--shadow-xl); }
.about-image-accent { position: absolute; top: -20px; left: -20px; width: 200px; height: 200px; background: var(--primary-light); border-radius: 16px; z-index: -1; }
.experience-badge { position: absolute; bottom: -30px; right: -30px; background: var(--white); padding: 24px 32px; border-radius: 16px; box-shadow: var(--shadow-xl); text-align: center; }
.exp-number { display: block; font-size: 42px; font-weight: 700; color: var(--primary); line-height: 1; }
.exp-text { font-size: 14px; color: var(--gray-600); line-height: 1.4; }
.about-text { color: var(--gray-600); margin-bottom: 20px; font-size: 16px; }
.about-features { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0; }
.feature-item { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--gray-700); }
.feature-item i { color: var(--success); font-size: 18px; }
.btn-learn-more { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; background: var(--gray-900); color: var(--white); border-radius: 8px; font-weight: 600; transition: var(--transition); }
.btn-learn-more:hover { background: var(--black); transform: translateY(-2px); }

/* Services */
.services-section { padding: 120px 0; background: var(--gray-50); }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.service-card { background: var(--white); padding: 36px 28px; border-radius: 16px; border: 1px solid var(--gray-200); transition: var(--transition); }
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); border-color: transparent; }
.service-card.featured { background: var(--gray-900); border-color: var(--gray-900); }
.service-card.featured h3, .service-card.featured p, .service-card.featured li { color: var(--white); }
.service-card.featured .service-link { color: var(--primary); }
.service-icon { width: 56px; height: 56px; background: var(--primary-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.service-icon i { font-size: 24px; color: var(--primary); }
.service-icon.gold { background: #FEF3C7; }
.service-icon.gold i { color: var(--gold); }
.service-icon.purple { background: #EDE9FE; }
.service-icon.purple i { color: #7C3AED; }
.service-icon.green { background: #D1FAE5; }
.service-icon.green i { color: var(--success); }
.service-card.featured .service-icon { background: rgba(255,255,255,0.1); }
.service-card.featured .service-icon i { color: var(--white); }
.service-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; color: var(--gray-900); }
.service-card p { color: var(--gray-500); margin-bottom: 20px; font-size: 15px; }
.service-features { list-style: none; margin-bottom: 20px; }
.service-features li { padding: 8px 0; color: var(--gray-600); font-size: 14px; border-bottom: 1px solid var(--gray-100); }
.service-card.featured .service-features li { border-color: rgba(255,255,255,0.1); }
.service-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--gray-900); transition: var(--transition); }
.service-link:hover { color: var(--primary); gap: 10px; }

/* Fleet */
.fleet-section { position: relative; padding: 120px 0; overflow: hidden; }
.fleet-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.fleet-bg img { width: 100%; height: 100%; object-fit: cover; }
.fleet-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.7) 100%); }
.fleet-section .container { position: relative; z-index: 2; }
.fleet-stats { display: flex; justify-content: center; gap: 80px; margin-bottom: 50px; }
.fleet-stat { text-align: center; color: var(--white); }
.fleet-stat i { font-size: 32px; color: var(--gold); margin-bottom: 16px; display: block; }
.fleet-stat-number { display: block; font-size: 48px; font-weight: 700; margin-bottom: 8px; }
.fleet-stat-label { color: rgba(255,255,255,0.6); font-size: 15px; }
.fleet-cta { text-align: center; }
.btn-fleet { display: inline-flex; align-items: center; gap: 12px; padding: 18px 40px; background: var(--gold); color: var(--black); border-radius: 8px; font-weight: 700; font-size: 16px; transition: var(--transition); }
.btn-fleet:hover { background: var(--gold-dark); transform: translateY(-2px); }

/* Ticker */
.ticker-section { background: var(--gray-900); padding: 16px 0; overflow: hidden; }
.ticker-wrapper { overflow: hidden; }
.ticker-content { display: flex; gap: 60px; }
.ticker-item { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.ticker-label { color: var(--gray-400); font-size: 13px; font-weight: 500; }
.ticker-value { color: var(--white); font-weight: 700; }
.ticker-change { font-size: 13px; font-weight: 600; }
.ticker-change.positive { color: var(--success); }
.ticker-change.negative { color: var(--danger); }

/* News */
.news-section { padding: 120px 0; }
.news-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; }
.news-card { background: var(--white); border-radius: 16px; overflow: hidden; border: 1px solid var(--gray-200); transition: var(--transition); }
.news-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.news-image { position: relative; height: 200px; overflow: hidden; }
.news-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.news-card:hover .news-image img { transform: scale(1.05); }
.news-category { position: absolute; top: 16px; left: 16px; padding: 6px 12px; background: var(--white); border-radius: 50px; font-size: 12px; font-weight: 600; color: var(--gray-700); }
.news-content { padding: 24px; }
.news-date { font-size: 13px; color: var(--gray-400); margin-bottom: 12px; }
.news-content h3 { font-size: 18px; font-weight: 600; color: var(--gray-900); margin-bottom: 12px; line-height: 1.4; }
.news-content p { color: var(--gray-500); font-size: 15px; margin-bottom: 16px; }
.news-link { font-weight: 600; color: var(--primary); }

/* Contact */
.contact-section { padding: 120px 0; background: var(--gray-50); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.contact-info .section-title { margin-bottom: 20px; }
.contact-info > p { color: var(--gray-600); margin-bottom: 40px; }
.contact-details { margin-bottom: 40px; }
.contact-item { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.contact-item i { width: 48px; height: 48px; background: var(--white); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 20px; box-shadow: var(--shadow); }
.contact-label { display: block; font-size: 13px; color: var(--gray-500); margin-bottom: 4px; }
.contact-item a, .contact-item span { font-weight: 600; color: var(--gray-900); }
.social-links { display: flex; gap: 12px; }
.social-link { width: 44px; height: 44px; background: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gray-600); transition: var(--transition); box-shadow: var(--shadow); }
.social-link:hover { background: var(--primary); color: var(--white); }
.contact-form-wrapper { background: var(--white); padding: 40px; border-radius: 20px; box-shadow: var(--shadow-lg); }
.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form .form-group { margin-bottom: 20px; }
.contact-form label { display: block; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--gray-200); border-radius: 10px; font-size: 15px; transition: var(--transition); background: var(--white); color: var(--gray-900); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.btn-submit { display: inline-flex; align-items: center; gap: 10px; padding: 16px 32px; background: var(--primary); color: var(--white); border-radius: 10px; font-weight: 600; transition: var(--transition); }
.btn-submit:hover { background: var(--primary-dark); }

/* Footer */
.footer { background: var(--gray-900); padding: 80px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px; padding-bottom: 60px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand img { height: 40px; margin-bottom: 20px; }
.footer-brand p { color: var(--gray-400); font-size: 15px; line-height: 1.7; }
.footer-links h4 { color: var(--white); font-size: 16px; margin-bottom: 24px; }
.footer-links a { display: block; color: var(--gray-400); padding: 8px 0; transition: var(--transition); }
.footer-links a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; }
.footer-bottom p { color: var(--gray-500); font-size: 14px; }
.footer-badges { display: flex; gap: 24px; }
.footer-badges span { display: flex; align-items: center; gap: 8px; color: var(--gray-400); font-size: 13px; }
.footer-badges i { color: var(--success); }

/* ============ APP CONTAINER ============ */
#app-container { display: none; min-height: 100vh; background: var(--gray-50); }

/* Top Bar */
.app-topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-height); background: var(--white); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--gray-600); transition: var(--transition); }
.sidebar-toggle:hover { background: var(--gray-100); }
.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--gray-900); }
.topbar-brand img { height: 32px; }
.topbar-center { display: flex; align-items: center; }
.market-ticker { display: flex; align-items: center; gap: 24px; padding: 8px 20px; background: var(--gray-50); border-radius: 50px; }
.ticker-item-app { display: flex; align-items: center; gap: 8px; }
.ticker-name { font-size: 12px; color: var(--gray-500); font-weight: 500; }
.ticker-price { font-weight: 700; color: var(--gray-900); }
.data-badge { font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--gray-600); transition: var(--transition); }
.topbar-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.notification-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; background: var(--danger); color: var(--white); font-size: 11px; font-weight: 600; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.lang-select-app { padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 6px; font-weight: 500; color: var(--gray-700); background: var(--white); }
.user-menu { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 50px; cursor: pointer; transition: var(--transition); }
.user-menu:hover { background: var(--gray-100); }
.user-avatar { width: 36px; height: 36px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); }
.user-name { font-weight: 600; color: var(--gray-700); }

/* Sidebar */
.sidebar { position: fixed; left: 0; top: var(--topbar-height); width: var(--sidebar-width); height: calc(100vh - var(--topbar-height)); background: var(--white); border-right: 1px solid var(--gray-200); overflow-y: auto; z-index: 99; }
.sidebar-nav { padding: 20px 16px; }
.nav-section { margin-bottom: 28px; }
.nav-section-title { display: block; font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 1px; padding: 0 12px; margin-bottom: 12px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; color: var(--gray-600); font-weight: 500; transition: var(--transition); margin-bottom: 4px; }
.sidebar-link:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); }
.sidebar-link i { width: 20px; font-size: 16px; }
.badge-new { margin-left: auto; padding: 3px 8px; background: var(--gold); color: var(--black); font-size: 10px; font-weight: 700; border-radius: 50px; }

/* Main Content */
.main-content { margin-left: var(--sidebar-width); margin-top: var(--topbar-height); padding: 32px; min-height: calc(100vh - var(--topbar-height)); }
.view-section { display: none; }
.view-section.active { display: block; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.page-header.centered { justify-content: center; text-align: center; }
.page-title { font-size: 28px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.page-subtitle { color: var(--gray-500); }
.page-actions { display: flex; gap: 12px; }
.btn-page-action { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px; font-weight: 600; color: var(--gray-700); transition: var(--transition); }
.btn-page-action:hover { border-color: var(--gray-300); background: var(--gray-50); }
.btn-page-action.primary { background: var(--primary); border-color: var(--primary); color: var(--white); }
.btn-page-action.primary:hover { background: var(--primary-dark); }

/* Dashboard Stats */
.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card-dash { background: var(--white); padding: 24px; border-radius: 16px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--gray-200); }
.stat-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.gold { background: #FEF3C7; color: var(--gold); }
.stat-icon.green { background: #D1FAE5; color: var(--success); }
.stat-icon.purple { background: #EDE9FE; color: #7C3AED; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-label { color: var(--gray-500); font-size: 14px; }

/* Dashboard Grid */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.dash-card { background: var(--white); border-radius: 16px; border: 1px solid var(--gray-200); overflow: hidden; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--gray-100); }
.card-header h3 { font-size: 16px; font-weight: 600; color: var(--gray-900); display: flex; align-items: center; gap: 10px; }
.card-header h3 i { color: var(--gray-400); }
.card-select { padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: 6px; font-size: 13px; color: var(--gray-600); }
.card-link { font-size: 14px; font-weight: 600; color: var(--primary); }
.card-body { padding: 24px; }

/* Market Overview */
.market-overview-grid { display: grid; gap: 20px; }
.market-item { padding: 16px; background: var(--gray-50); border-radius: 12px; }
.market-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.market-name { font-weight: 600; color: var(--gray-700); }
.market-change { font-weight: 600; font-size: 14px; }
.market-change.positive { color: var(--success); }
.market-change.negative { color: var(--danger); }
.market-value { font-size: 20px; font-weight: 700; color: var(--gray-900); display: block; margin-bottom: 12px; }
.market-bar { height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }

/* Quick Actions */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; background: var(--gray-50); border-radius: 12px; transition: var(--transition); }
.quick-action-btn:hover { background: var(--primary-light); }
.quick-action-btn i { font-size: 24px; color: var(--primary); }
.quick-action-btn span { font-weight: 600; color: var(--gray-700); font-size: 13px; }

/* News List */
.news-list { display: flex; flex-direction: column; gap: 16px; }
.news-item-small { padding-bottom: 16px; border-bottom: 1px solid var(--gray-100); }
.news-item-small:last-child { border-bottom: none; padding-bottom: 0; }
.news-date-small { font-size: 12px; color: var(--gray-400); margin-bottom: 6px; display: block; }
.news-item-small p { color: var(--gray-700); font-weight: 500; line-height: 1.5; }

/* Calculator Layout */
.calculator-layout { display: grid; grid-template-columns: 320px 1fr 360px; gap: 20px; height: calc(100vh - 180px); }
.calc-panel { background: var(--white); border-radius: 16px; border: 1px solid var(--gray-200); overflow: hidden; display: flex; flex-direction: column; color: var(--gray-800); }
.panel-header { padding: 16px 20px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); font-weight: 600; color: var(--gray-700); display: flex; align-items: center; gap: 10px; }
.panel-header i { color: var(--primary); }
.panel-body { padding: 20px; overflow-y: auto; flex: 1; color: var(--gray-800); }
.map-panel { padding: 0 !important; width: 100% !important; height: 100% !important; position: relative; }
#map { width: 100% !important; height: 100% !important; min-height: 500px; max-width: none !important; position: absolute !important; top: 0; left: 0; right: 0; bottom: 0; }

/* Form Elements */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px; color: var(--gray-900); background: var(--white); transition: var(--transition); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { color: var(--gray-500); margin-bottom: 20px; }
.form-checkbox { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.form-checkbox input { width: 18px; height: 18px; }
.form-checkbox a { color: var(--primary); font-weight: 500; }

/* Buttons */
.btn-scan { width: 100%; padding: 14px; background: var(--primary); color: var(--white); border-radius: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); margin-top: 8px; }
.btn-scan:hover { background: var(--primary-dark); }
.btn-breakdown { width: 100%; padding: 12px; background: var(--gray-100); color: var(--gray-700); border-radius: 8px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 20px; transition: var(--transition); }
.btn-breakdown:hover { background: var(--gray-200); }
.btn-generate { width: 100%; padding: 16px; background: var(--primary); color: var(--white); border-radius: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; transition: var(--transition); }
.btn-generate:hover { background: var(--primary-dark); }
.btn-publish { width: 100%; padding: 16px; background: var(--gold); color: var(--black); border-radius: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; transition: var(--transition); }
.btn-publish:hover { background: var(--gold-dark); }
.btn-filter { padding: 12px 20px; background: var(--gray-900); color: var(--white); border-radius: 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-filter:hover { background: var(--black); }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* Result Stats */
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.result-stat { padding: 16px; background: var(--gray-50); border-radius: 10px; text-align: center; }
.result-stat.highlight { background: var(--primary-light); }
.result-label { display: block; font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.result-value { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.result-stat.highlight .result-value { color: var(--primary); }

/* Financial Details */
.financial-details { margin-top: 16px; }
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    transition: background 0.2s ease;
}

.detail-row:hover {
    background: rgba(14, 165, 233, 0.05);
    padding-left: 8px;
    margin-left: -8px;
    border-radius: 4px;
}

.d-lbl {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.d-val {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

/* AI Analysis */
.ai-analysis { margin-top: 20px; padding: 16px; background: var(--primary-light); border-radius: 10px; border-left: 4px solid var(--primary); }
.ai-analysis p { color: var(--gray-700); font-size: 14px; line-height: 1.6; }

/* Cargo List */
.cargo-list { margin-top: 20px; }
.cargo-item {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-left: 4px solid #0ea5e9;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cargo-item:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
    border-left-width: 6px;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.cargo-item.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(6, 182, 212, 0.15) 100%);
    border: 2px solid #0ea5e9;
    border-left-width: 6px;
    box-shadow: 0 8px 16px rgba(14, 165, 233, 0.3);
}

.ci-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.ci-top span:first-child {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.ci-bot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    opacity: 0.8;
}

.tce-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Marketplace */
.marketplace-filters { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-select, .filter-input { padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: 8px; background: var(--white); min-width: 140px; }
.marketplace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.vessel-card { background: var(--white); border-radius: 16px; border: 1px solid var(--gray-200); overflow: hidden; transition: var(--transition); }
.vessel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.vessel-image { height: 180px; background: var(--gray-100); position: relative; overflow: hidden; }
.vessel-image img { width: 100%; height: 100%; object-fit: cover; }
.vessel-image i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 48px; color: var(--gray-300); }
.vessel-type-badge { position: absolute; top: 12px; right: 12px; padding: 6px 12px; background: var(--gold); color: var(--black); font-size: 11px; font-weight: 700; border-radius: 50px; }
.vessel-info { padding: 20px; }
.vessel-name { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.vessel-specs { color: var(--gray-500); font-size: 14px; margin-bottom: 12px; }
.vessel-price { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.btn-view-vessel { width: 100%; padding: 12px; background: var(--gray-100); color: var(--gray-700); border-radius: 8px; font-weight: 600; transition: var(--transition); }
.btn-view-vessel:hover { background: var(--primary); color: var(--white); }

/* Templates */
.templates-container { }
.template-category { margin-bottom: 40px; }
.template-category h3 { font-size: 18px; font-weight: 600; color: var(--gray-800); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.template-category h3 i { color: var(--primary); }
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* Content Grid */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.content-card { background: var(--white); border-radius: 16px; border: 1px solid var(--gray-200); padding: 24px; transition: var(--transition); }
.content-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.content-card-icon { width: 48px; height: 48px; background: var(--primary-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.content-card-icon i { font-size: 20px; color: var(--primary); }
.content-card h3 { font-size: 18px; font-weight: 600; color: var(--gray-900); margin-bottom: 8px; }
.content-card p { color: var(--gray-500); font-size: 14px; margin-bottom: 16px; }
.btn-content { padding: 10px 16px; background: var(--gray-100); color: var(--gray-700); border-radius: 8px; font-weight: 600; font-size: 14px; transition: var(--transition); }
.btn-content:hover { background: var(--primary); color: var(--white); }

/* Doc Card (for dynamic content) */
.doc-card { background: var(--white); border-radius: 16px; border: 1px solid var(--gray-200); padding: 24px; transition: var(--transition); text-align: center; color: var(--gray-800); }
.doc-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.doc-icon { font-size: 36px; margin-bottom: 16px; display: block; }
.doc-title { font-size: 18px; font-weight: 600; color: var(--gray-900); margin-bottom: 8px; }
.doc-desc { color: var(--gray-500); font-size: 14px; margin-bottom: 16px; }
.btn-download { width: 100%; padding: 12px; background: var(--gray-100); color: var(--gray-700); border-radius: 8px; font-weight: 600; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-download:hover { background: var(--primary); color: var(--white); }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; max-width: 1000px; margin: 0 auto; }
.pricing-card { background: var(--white); border-radius: 20px; border: 1px solid var(--gray-200); padding: 40px 32px; position: relative; transition: var(--transition); }
.pricing-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.pricing-card.popular { border-color: var(--primary); }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 6px 16px; background: var(--primary); color: var(--white); font-size: 12px; font-weight: 700; border-radius: 50px; }
.pricing-header { text-align: center; margin-bottom: 32px; }
.plan-name { font-size: 20px; font-weight: 600; color: var(--gray-900); margin-bottom: 16px; }
.plan-price { font-size: 48px; font-weight: 700; color: var(--gray-900); }
.plan-price span { font-size: 16px; font-weight: 400; color: var(--gray-500); }
.plan-desc { color: var(--gray-500); margin-top: 8px; }
.plan-features { list-style: none; margin-bottom: 32px; }
.plan-features li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.plan-features li i { color: var(--success); }
.plan-features li.disabled { color: var(--gray-400); }
.plan-features li.disabled i { color: var(--gray-300); }
.btn-plan { width: 100%; padding: 16px; border-radius: 10px; font-weight: 600; transition: var(--transition); }
.btn-plan.current { background: var(--gray-100); color: var(--gray-500); }
.btn-plan.primary { background: var(--primary); color: var(--white); }
.btn-plan.primary:hover { background: var(--primary-dark); }
.btn-plan:not(.current):not(.primary) { background: var(--gray-900); color: var(--white); }
.btn-plan:not(.current):not(.primary):hover { background: var(--black); }

/* Modals */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; }
.modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.modal-container { position: relative; background: var(--white); border-radius: 20px; max-width: 480px; margin: 80px auto; max-height: calc(100vh - 160px); overflow-y: auto; animation: modalIn 0.3s ease; color: var(--gray-800); }
@keyframes modalIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-container.large-modal { max-width: 800px; }
.modal-container.chat-modal { max-width: 500px; display: flex; flex-direction: column; height: 600px; }
.modal-container.video-modal { max-width: 900px; background: var(--black); color: var(--white); }
.modal-close { position: absolute; top: 20px; right: 20px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--gray-500); transition: var(--transition); }
.modal-close:hover { background: var(--gray-100); color: var(--gray-900); }
.modal-header { padding: 24px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 20px; font-weight: 600; color: var(--gray-900); }
.modal-body { padding: 24px; color: var(--gray-700); }

/* Modal Body Typography */
.modal-body h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 24px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
}

.modal-body h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-body h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-top: 16px;
    margin-bottom: 8px;
}

.modal-body p {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 16px;
}

.modal-body ul, .modal-body ol {
    margin-left: 24px;
    margin-bottom: 16px;
    color: var(--gray-600);
}

.modal-body li {
    line-height: 1.8;
    margin-bottom: 8px;
}

.modal-body strong {
    font-weight: 600;
    color: var(--gray-900);
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.modal-body table th {
    background: var(--gray-100);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
}

.modal-body table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.modal-body table tr:last-child td {
    border-bottom: none;
}

.modal-body table tr:hover {
    background: var(--gray-50);
}

.modal-body div[style*="background"] {
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

/* Auth Modal */
.auth-modal { text-align: center; padding: 40px; }
.auth-header { margin-bottom: 32px; }
.auth-header img { height: 48px; margin-bottom: 20px; }
.auth-header h2 { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.auth-header p { color: var(--gray-500); }
.auth-tabs { display: flex; gap: 4px; background: var(--gray-100); border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 12px; border-radius: 8px; font-weight: 600; color: var(--gray-500); transition: var(--transition); }
.auth-tab.active { background: var(--white); color: var(--gray-900); box-shadow: var(--shadow); }
.auth-form { text-align: left; }
.auth-form .form-group { margin-bottom: 16px; }
.btn-auth { width: 100%; padding: 14px; background: var(--primary); color: var(--white); border-radius: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); }
.btn-auth:hover { background: var(--primary-dark); }
.auth-message { margin-top: 16px; padding: 12px; border-radius: 8px; font-size: 14px; }

/* Profile Modal */
.profile-modal { text-align: center; padding: 40px; }
.profile-header { margin-bottom: 32px; }
.profile-avatar { width: 80px; height: 80px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.profile-avatar i { font-size: 36px; color: var(--white); }
.profile-header h2 { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.profile-header p { color: var(--gray-500); margin-bottom: 12px; }
.plan-badge { display: inline-block; padding: 6px 14px; background: var(--gold); color: var(--black); font-size: 12px; font-weight: 700; border-radius: 50px; }
.profile-actions { display: flex; flex-direction: column; gap: 12px; }
.profile-btn { padding: 14px; background: var(--gray-100); color: var(--gray-700); border-radius: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); }
.profile-btn:hover { background: var(--gray-200); }
.profile-btn.danger { background: #FEE2E2; color: var(--danger); }
.profile-btn.danger:hover { background: #FECACA; }

/* Messaging */
.message-history { flex: 1; padding: 20px; overflow-y: auto; background: var(--gray-50); display: flex; flex-direction: column; gap: 12px; }
.message-input-area { padding: 16px; border-top: 1px solid var(--gray-200); display: flex; gap: 12px; background: var(--white); }
.message-input { flex: 1; padding: 12px 16px; border: 1px solid var(--gray-200); border-radius: 50px; background: var(--white); color: var(--gray-900); }
.btn-send { width: 44px; height: 44px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); transition: var(--transition); }
.btn-send:hover { background: var(--primary-dark); }
.chat-actions { display: flex; gap: 8px; }
.btn-video { width: 36px; height: 36px; background: var(--gold); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--black); }

/* Video Call */
.video-header { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; color: var(--white); }
.btn-copy-link { padding: 8px 16px; background: rgba(255,255,255,0.1); border-radius: 50px; color: var(--white); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 24px 24px; }
.video-box { position: relative; border-radius: 12px; overflow: hidden; background: var(--gray-900); }
.video-box video { width: 100%; height: 300px; object-fit: cover; }
.video-label { position: absolute; bottom: 12px; left: 12px; padding: 6px 12px; background: rgba(0,0,0,0.7); border-radius: 50px; color: var(--white); font-size: 13px; }
.video-controls { padding: 24px; display: flex; justify-content: center; gap: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.video-btn { width: 56px; height: 56px; border-radius: 50%; background: var(--gray-800); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 20px; transition: var(--transition); }
.video-btn:hover { background: var(--gray-700); }
.video-btn.danger { background: var(--danger); }
.video-btn.danger:hover { background: #DC2626; }

/* Doc Output */
.doc-disclaimer { padding: 16px; background: #FEF3C7; border-radius: 10px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; color: var(--gray-800); }
.doc-disclaimer i { color: var(--warning); font-size: 20px; }
.doc-output { width: 100%; height: 400px; padding: 20px; border: 1px solid var(--gray-200); border-radius: 10px; font-family: monospace; font-size: 14px; resize: none; background: var(--white); color: var(--gray-900); }
.doc-actions { display: flex; gap: 12px; margin-top: 16px; }
.btn-doc-action { flex: 1; padding: 12px; background: var(--gray-100); color: var(--gray-700); border-radius: 8px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); }
.btn-doc-action:hover { background: var(--gray-200); }

/* Image Upload */
.image-upload { margin-top: 20px; }
.image-upload label { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; border: 2px dashed var(--gray-300); border-radius: 12px; cursor: pointer; transition: var(--transition); color: var(--gray-700); }
.image-upload label:hover { border-color: var(--primary); background: var(--primary-light); }
.image-upload label span { color: var(--gray-600); font-weight: 500; }
.image-upload i { font-size: 32px; color: var(--gray-400); }
.image-upload input { display: none; }
.image-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.image-preview img { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--gray-200); }

/* Legal Content */
.legal-content { max-height: 400px; overflow-y: auto; color: var(--gray-600); line-height: 1.8; }
.btn-agree { width: 100%; padding: 14px; background: var(--primary); color: var(--white); border-radius: 10px; font-weight: 600; margin-top: 20px; }

/* OTP Modal */
.otp-modal { max-width: 440px; }
.otp-modal-content { padding: 40px 32px; text-align: center; }
.otp-icon { width: 80px; height: 80px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.otp-icon i { font-size: 36px; color: var(--primary); }
.otp-title { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; }
.otp-subtitle { color: var(--gray-500); font-size: 15px; line-height: 1.6; margin-bottom: 32px; }
.otp-subtitle span { font-weight: 600; color: var(--gray-700); }
.otp-input-container { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.otp-input { width: 50px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; border: 2px solid var(--gray-200); border-radius: 12px; color: var(--gray-900); transition: var(--transition); }
.otp-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.otp-input:not(:placeholder-shown) { border-color: var(--primary); background: var(--primary-light); }
.otp-error { padding: 12px 16px; background: #FEE2E2; color: var(--danger); border-radius: 8px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.otp-error::before { content: '\f06a'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }
.btn-verify-otp { width: 100%; padding: 16px; background: var(--primary); color: var(--white); border-radius: 10px; font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); margin-bottom: 20px; }
.btn-verify-otp:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-verify-otp:active { transform: translateY(0); }
.otp-resend { padding-top: 20px; border-top: 1px solid var(--gray-200); }
.otp-resend p { color: var(--gray-500); font-size: 14px; margin-bottom: 10px; }
.btn-resend-otp { padding: 10px 20px; background: var(--gray-100); color: var(--gray-700); border-radius: 8px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-resend-otp:hover { background: var(--gray-200); }
.btn-resend-otp:disabled { opacity: 0.5; cursor: not-allowed; }

/* OTP Animation */
@keyframes otpPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.otp-input.filled { animation: otpPulse 0.3s ease; }

/* Leaflet Map Container Fix */
.leaflet-container { width: 100% !important; height: 100% !important; }
.leaflet-pane { width: 100% !important; height: 100% !important; }

/* AI Chat Widget */
.ai-chat-widget { display: none; position: fixed; bottom: 24px; right: 24px; width: 380px; height: 520px; background: var(--white); border-radius: 20px; box-shadow: var(--shadow-xl); z-index: 1000; flex-direction: column; overflow: hidden; border: 1px solid var(--gray-200); }
.chat-widget-header { padding: 16px 20px; background: var(--primary); color: var(--white); display: flex; justify-content: space-between; align-items: center; }
.chat-widget-title { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.chat-widget-actions { display: flex; gap: 8px; }
.chat-widget-actions button { color: var(--white); opacity: 0.8; transition: var(--transition); }
.chat-widget-actions button:hover { opacity: 1; }
.chat-widget-body { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--primary); color: var(--white); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--gray-100); color: var(--gray-800); border-bottom-left-radius: 4px; }
.chat-widget-input { padding: 16px; border-top: 1px solid var(--gray-200); display: flex; gap: 12px; background: var(--white); }
.chat-widget-input input { flex: 1; padding: 12px 16px; border: 1px solid var(--gray-200); border-radius: 50px; background: var(--white); color: var(--gray-900); }
.chat-widget-input button { width: 44px; height: 44px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); }

/* Finance Table */
.fin-table { width: 100%; border-collapse: collapse; }
.fin-table th, .fin-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--gray-200); color: var(--gray-800); }
.fin-table th { color: var(--gray-500); font-weight: 600; font-size: 13px; }
.fin-table tr:hover { background: var(--gray-50); }
.text-green-400 { color: var(--success); }
.text-red-300, .text-red-400 { color: var(--danger); }
.text-orange-300 { color: var(--warning); }
.fin-grand-total td { font-size: 18px; font-weight: 700; border-top: 2px solid var(--gray-900); padding-top: 16px; }

/* Responsive */
@media (max-width: 1200px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .calculator-layout { grid-template-columns: 1fr; height: auto; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-menu { display: none; }
    .nav-toggle { display: block; }
    .hero-actions { flex-direction: column; }
    .hero-stats { flex-direction: column; gap: 20px; }
    .stat-divider { display: none; }
    .services-grid { grid-template-columns: 1fr; }
    .news-grid { grid-template-columns: 1fr; }
    .fleet-stats { flex-direction: column; gap: 30px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 16px; }
    .dashboard-stats { grid-template-columns: 1fr; }
    .marketplace-filters { flex-direction: column; }
    .modal-container { margin: 20px; max-height: calc(100vh - 40px); }
}

.password-wrapper {
    position: relative;
}
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 5px;
}
.toggle-password:hover {
    color: #374151;
}

.forgot-password {
    text-align: center;
    margin-top: 16px;
}
.forgot-password a {
    color: #0066FF;
    font-size: 14px;
    font-weight: 500;
}
.forgot-password a:hover {
    text-decoration: underline;
}

/* Sidebar Toggle */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.main-content.expanded {
    margin-left: 0;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}

/* Dark Mode Variables */
body.dark-mode {
    --white: #0f172a;
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #e2e8f0;
    --gray-700: #f1f5f9;
    --gray-800: #f8fafc;
    --gray-900: #ffffff;
    --black: #ffffff;
}

body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark-mode .landing-nav {
    background: rgba(15, 23, 42, 0.95);
    border-color: #334155;
}

body.dark-mode .app-topbar {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .sidebar {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .main-content {
    background: #0f172a;
}

body.dark-mode .dash-card,
body.dark-mode .stat-card-dash,
body.dark-mode .calc-panel,
body.dark-mode .content-card,
body.dark-mode .pricing-card,
body.dark-mode .vessel-card,
body.dark-mode .news-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .card-header {
    border-color: #334155;
}

body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea,
body.dark-mode .filter-select,
body.dark-mode .filter-input {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .modal-container {
    background: #1e293b;
}

body.dark-mode .modal-header {
    border-color: #334155;
}

/* Dark Mode - Modal Body Typography */
body.dark-mode .modal-body h3,
body.dark-mode .modal-body h4,
body.dark-mode .modal-body h5,
body.dark-mode .modal-body strong {
    color: #f1f5f9;
}

body.dark-mode .modal-body p,
body.dark-mode .modal-body li,
body.dark-mode .modal-body td {
    color: #94a3b8;
}

body.dark-mode .modal-body table {
    background: #1e293b;
    border-color: #475569;
}

body.dark-mode .modal-body table th {
    background: #334155;
    color: #e2e8f0;
    border-color: #64748b;
}

body.dark-mode .modal-body table td {
    border-color: #475569;
}

body.dark-mode .modal-body table tr:hover {
    background: #334155;
}

body.dark-mode .sidebar-link:hover {
    background: #334155;
}

body.dark-mode .market-ticker {
    background: #334155;
}

body.dark-mode .page-title,
body.dark-mode .section-title,
body.dark-mode .card-header h3 {
    color: #f1f5f9;
}

body.dark-mode .page-subtitle,
body.dark-mode .stat-label {
    color: #94a3b8;
}

body.dark-mode .quick-action-btn {
    background: #334155;
}

body.dark-mode .quick-action-btn:hover {
    background: #475569;
}

body.dark-mode .btn-page-action {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .cargo-item {
    background: #334155;
    border-color: #475569;
}

body.dark-mode .cargo-item:hover,
body.dark-mode .cargo-item.active {
    border-color: var(--primary);
}

body.dark-mode .result-stat {
    background: #334155;
}

body.dark-mode .ai-analysis {
    background: rgba(0, 102, 255, 0.1);
}

body.dark-mode .ai-chat-widget {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .chat-widget-body {
    background: #0f172a;
}

body.dark-mode .msg.ai {
    background: #334155;
    color: #e2e8f0;
}

.theme-toggle {
    font-size: 18px;
}

/* Maritime News Styles */
.news-page-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px 24px;
    transition: all 0.2s ease;
}

.news-card-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
}

body.dark-mode .news-card-item {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .news-card-item:hover {
    border-color: var(--primary);
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.news-source {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

body.dark-mode .news-source {
    background: rgba(0, 102, 255, 0.2);
}

.news-date {
    color: var(--gray-400);
    font-size: 13px;
}

.news-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 10px;
    line-height: 1.4;
}

body.dark-mode .news-title {
    color: #f1f5f9;
}

.news-snippet {
    color: var(--gray-500);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

body.dark-mode .news-snippet {
    color: #94a3b8;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    transition: gap 0.2s ease;
}

.news-read-more:hover {
    gap: 10px;
}

/* Modal Body Content Typography */
.modal-body h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 24px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
}

.modal-body h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-body h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-top: 16px;
    margin-bottom: 8px;
}

.modal-body p {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 16px;
}

.modal-body ul, .modal-body ol {
    margin-left: 24px;
    margin-bottom: 16px;
    color: var(--gray-600);
}

.modal-body li {
    line-height: 1.8;
    margin-bottom: 8px;
}

.modal-body strong {
    font-weight: 600;
    color: var(--gray-900);
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.modal-body table th {
    background: var(--gray-100);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
}

.modal-body table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.modal-body table tr:last-child td {
    border-bottom: none;
}

.modal-body table tr:hover {
    background: var(--gray-50);
}

.modal-body div[style*="background"] {
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

/* Dark Mode Support for Modal Content */
body.dark-mode .modal-body h3,
body.dark-mode .modal-body h4,
body.dark-mode .modal-body h5,
body.dark-mode .modal-body strong {
    color: #f1f5f9;
}

body.dark-mode .modal-body p,
body.dark-mode .modal-body li,
body.dark-mode .modal-body td {
    color: #94a3b8;
}

body.dark-mode .modal-body table {
    background: #1e293b;
    border-color: #475569;
}

body.dark-mode .modal-body table th {
    background: #334155;
    color: #e2e8f0;
    border-color: #64748b;
}

body.dark-mode .modal-body table td {
    border-color: #475569;
}

body.dark-mode .modal-body table tr:hover {
    background: #334155;
}
/* ================================================
   MESSAGING SYSTEM - ANIMATIONS & IMPROVEMENTS
   ================================================ */

/* Message slide-in animation */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message history smooth scroll */
.message-history,
#messageHistory {
    scroll-behavior: smooth;
}

/* Message item hover effect */
.message-item {
    transition: transform 0.2s ease;
}

.message-item:hover {
    transform: translateX(-2px);
}

/* Dark mode message colors */
body.dark-mode .message-item div[style*="background: #1a1a1a"] {
    background: #334155 !important;
}

body.dark-mode .message-item div[style*="background: #1e3a8a"] {
    background: #1e40af !important;
}

/* Message loading state */
.message-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
}

.message-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #64748b;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 0.8s linear infinite;
}

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

/* Empty state styling */
.message-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.message-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Message timestamp */
.message-item [style*="font-size: 0.7rem"] {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.message-item:hover [style*="font-size: 0.7rem"] {
    opacity: 1;
}

/* ================================================
   MAP ROUTE ANIMATIONS
   ================================================ */

/* Animated dashed line for ballast route */
@keyframes dash {
    to {
        stroke-dashoffset: -20;
    }
}

.route-line-ballast {
    animation: dash 1s linear infinite;
}
