/* Custom CSS for Sovereign Trader */

/* Brand Colors */
:root {
    --navy: #2C3E50;        /* Primary dark - from logo */
    --gold: #C9A961;        /* Accent - from logo */
    --off-white: #F5F5F0;   /* Background */
    --light-gray: #E8E8E8;  /* Borders */
    --dark-gray: #666666;   /* Secondary text */
    --white: #FFFFFF;

    /* Typography tokens */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --text-page-title: 1.75rem;    /* 28px */
    --text-section: 1.25rem;       /* 20px */
    --text-card-label: 0.75rem;    /* 12px */
    --text-body: 0.9375rem;        /* 15px */

    /* Spacing tokens */
    --sidebar-width: 15rem;        /* 240px */
    --main-padding: 2.5rem;        /* 40px */
    --section-gap: 2rem;           /* 32px */
    --card-gap: 1rem;              /* 16px */
    --card-padding: 1.5rem;        /* 24px */
    --card-radius: 0.5rem;         /* 8px */
}

/* Brand Typography */
body {
    font-family: var(--font-body);
    font-size: var(--text-body);
}

h1, h2, h3, h4, h5, h6, .brand-heading, .nav-brand-text {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.02em;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Card styles */
.card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-hover {
    @apply hover:shadow-lg;
}

/* Button styles */
.btn-primary {
    background-color: var(--navy);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid var(--navy);
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--gold);
    border-color: var(--gold);
    color: var(--navy);
}

.btn-secondary {
    background-color: transparent;
    color: var(--navy);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid var(--navy);
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--navy);
    color: white;
}

.btn-destructive {
    background-color: transparent;
    color: #dc2626;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid #dc2626;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.btn-destructive:hover {
    background-color: #dc2626;
    color: white;
}

/* HTMX loading indicators */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Badge styles */
.badge {
    @apply inline-block px-3 py-1 rounded-full text-sm font-semibold;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

.badge-info {
    @apply bg-blue-100 text-blue-800;
}

/* Brand-specific styles */
.logo {
    width: 50px;
    height: 50px;
    background: #F5F5F0;
    border-radius: 50%;
    padding: 4px;
    object-fit: contain;
}

.logo-large {
    width: 140px;
    height: 140px;
    background: #F5F5F0;
    border-radius: 50%;
    padding: 12px;
    object-fit: contain;
}

.brand-heading {
    color: var(--navy);
    font-weight: 700;
}

.brand-accent {
    color: var(--gold);
}

.brand-bg {
    background-color: var(--off-white);
}

.brand-nav {
    background-color: var(--navy);
    color: white;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, #1a252f 100%);
    color: white;
}

.hero-accent {
    color: var(--gold);
}

/* Feature cards */
.feature-card {
    border-top: 4px solid var(--gold);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(44, 62, 80, 0.15);
}

/* Feature icons */
.feature-icon {
    width: 64px;
    height: 64px;
    background-color: var(--navy);
    color: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
}

/* Links */
a.brand-link {
    color: var(--navy);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

a.brand-link:hover {
    border-bottom-color: var(--gold);
}

/* Sidebar navigation hover */
aside nav a:not([style*="background-color"]):hover {
    background-color: var(--off-white);
    color: var(--navy);
}

/* Typography utility classes */
.page-title {
    font-family: var(--font-heading);
    font-size: var(--text-page-title);
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.02em;
}

.section-heading {
    font-family: var(--font-heading);
    font-size: var(--text-section);
    font-weight: 600;
    color: var(--navy);
    letter-spacing: 0.02em;
}

.card-label {
    font-size: var(--text-card-label);
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Layout utilities */
.dashboard-sections {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
}

/* ─── Mobile Responsiveness ─── */

/* Hamburger toggle: hidden on desktop */
.sidebar-toggle {
    display: none;
    background: var(--navy);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    /* Show hamburger */
    .sidebar-toggle {
        display: block;
    }

    /* Stack layout vertically */
    .dashboard-layout {
        flex-direction: column;
    }

    /* Hide sidebar by default on mobile */
    .dashboard-sidebar {
        display: none;
        width: 100% !important;
        position: static;
    }

    /* Show sidebar when toggled */
    .dashboard-sidebar.sidebar-open {
        display: block;
    }

    /* Scale down page title */
    .page-title {
        font-size: 1.375rem;
    }

    .section-heading {
        font-size: 1.1rem;
    }

    /* Allow tables to scroll horizontally */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack grid columns on mobile */
    .grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.2rem;
    }

    .section-heading {
        font-size: 1rem;
    }

    /* Reduce card padding on very small screens */
    .card {
        padding: 1rem;
    }
}
