/* ==========================================================================
   OilyFans Design System
   ========================================================================== */

/* 1. CSS Variables & Design Tokens
   ========================================================================== */
:root {
    /* Background Colors */
    --bg: #061018;          /* Main background */
    --bg2: #0f141c;         /* Card background 1 */
    --bg3: #0b1017;         /* Card background 2 */

    /* Text Colors */
    --text: #e8edf4;         /* Primary text */
    --muted: #a9b5c6;        /* Secondary/muted text */

    /* Accent Colors */
    --accent: #19d3ff;       /* Primary accent (cyan/blue) */
    --accent2: #7cf7c6;      /* Secondary accent (mint/green) */

    /* UI Elements */
    --line: #1c2636;         /* Borders/dividers */
    --shadow: 0 18px 60px rgba(0, 0, 0, .45);
    --radius: 18px;          /* Default border radius */

    /* States */
    --error: #ff4d4d;        /* Error state */
    --success: #4dff88;      /* Success state */
}

/* 2. Font Face & Global Styles
   ========================================================================== */
@font-face {
    font-family: 'Conthrax';
    src: url('fonts/conthrax-sb.woff2') format('woff2'),
         url('fonts/conthrax-sb.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Conthrax', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(1200px 800px at 70% -10%, rgba(25, 211, 255, .18), transparent 55%),
                radial-gradient(900px 700px at 10% 0%, rgba(124, 247, 198, .10), transparent 55%),
                var(--bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* 3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Conthrax', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent2);
}

/* 4. Layout Containers
   ========================================================================== */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

.content {
    padding: 22px 0;
}

/* 5. Cards
   ========================================================================== */
.card {
    border: 1px solid rgba(28, 38, 54, .9);
    background: linear-gradient(180deg, rgba(15, 20, 28, .85), rgba(11, 16, 23, .75));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    margin: -20px -20px 20px -20px;
}

.card-body {
    padding: 16px 0;
}

.card-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    margin: 20px -20px -20px -20px;
}

/* Media Card for Images */
.mediaCard {
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 360px;
    padding: 0;
}

.mediaTop {
    position: relative;
    background: radial-gradient(700px 400px at 30% 20%, rgba(25, 211, 255, .20), transparent 55%),
                radial-gradient(700px 400px at 70% 90%, rgba(124, 247, 198, .12), transparent 55%),
                rgba(9, 12, 16, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mediaTop img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 360px;
    filter: drop-shadow(0 18px 60px rgba(0, 0, 0, .55));
    border-radius: 12px;
}

.mediaBottom {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(28, 38, 54, .9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* 6. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(25, 211, 255, .35);
    background: rgba(25, 211, 255, .08);
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .28);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Conthrax', sans-serif;
}

.btn:hover {
    transform: translateY(-1px);
    background: rgba(25, 211, 255, .12);
    border-color: rgba(25, 211, 255, .55);
    color: var(--text);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn.primary {
    background: linear-gradient(135deg, rgba(25, 211, 255, .95), rgba(124, 247, 198, .75));
    color: #061018;
    border-color: rgba(255, 255, 255, .25);
}

.btn.primary:hover {
    background: linear-gradient(135deg, rgba(25, 211, 255, 1), rgba(124, 247, 198, .85));
    color: #061018;
}

.btn.danger {
    background: rgba(255, 77, 77, .15);
    border-color: rgba(255, 77, 77, .35);
    color: var(--error);
}

.btn.danger:hover {
    background: rgba(255, 77, 77, .25);
    border-color: rgba(255, 77, 77, .55);
    color: var(--error);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 20px;
    font-size: 16px;
}

/* 7. Forms
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(28, 38, 54, .9);
    background: rgba(11, 16, 23, .55);
    color: var(--text);
    font-family: 'Conthrax', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(25, 211, 255, .15);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Validation */
.valid.modified:not([type=checkbox]) {
    border-color: var(--success);
}

.invalid {
    border-color: var(--error);
}

.validation-message {
    color: var(--error);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

/* 8. Grid System
   ========================================================================== */
.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);
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

.row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.row > * {
    flex: 1;
}

@media (max-width: 600px) {
    .row {
        flex-direction: column;
    }
}

/* 9. Badges & Pills
   ========================================================================== */
.badge {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(28, 38, 54, .9);
    background: rgba(11, 16, 23, .55);
    font-weight: 800;
    font-size: 12px;
    display: inline-block;
}

.pill {
    padding: 8px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    color: rgba(232, 237, 244, .92);
    border: 1px solid rgba(28, 38, 54, .9);
    background: rgba(11, 16, 23, .55);
    display: inline-block;
}

.pillRow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-new {
    background: rgba(25, 211, 255, .15);
    color: var(--accent);
}

.status-contacted {
    background: rgba(255, 193, 7, .15);
    color: #ffc107;
}

.status-qualified {
    background: rgba(124, 247, 198, .15);
    color: var(--accent2);
}

.status-won {
    background: rgba(77, 255, 136, .15);
    color: var(--success);
}

.status-lost {
    background: rgba(255, 77, 77, .15);
    color: var(--error);
}

/* 10. Tables
   ========================================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid rgba(28, 38, 54, .5);
}

.table tbody tr:hover {
    background: rgba(25, 211, 255, .05);
}

/* 11. Alerts & Messages
   ========================================================================== */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid;
}

.alert-info {
    background: rgba(25, 211, 255, .1);
    border-color: rgba(25, 211, 255, .3);
    color: var(--accent);
}

.alert-success {
    background: rgba(77, 255, 136, .1);
    border-color: rgba(77, 255, 136, .3);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 193, 7, .1);
    border-color: rgba(255, 193, 7, .3);
    color: #ffc107;
}

.alert-danger,
.alert-error {
    background: rgba(255, 77, 77, .1);
    border-color: rgba(255, 77, 77, .3);
    color: var(--error);
}

/* 12. Vertical Sidebar Navigation
   ========================================================================== */

/* App Layout Container */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(15, 20, 28, .95), rgba(11, 16, 23, .90));
    border-right: 1px solid var(--line);
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 70px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    transition: opacity 0.2s ease, width 0.2s ease;
}

.sidebar.collapsed .sidebar-brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: rgba(25, 211, 255, .08);
    border: 1px solid rgba(25, 211, 255, .35);
    border-radius: 8px;
    color: var(--text);
    font-size: 20px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.sidebar-toggle:hover {
    background: rgba(25, 211, 255, .15);
    border-color: var(--accent);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(25, 211, 255, .08);
    color: var(--accent);
}

.nav-item.active {
    background: rgba(25, 211, 255, .12);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    padding-left: 17px;
}

.nav-icon {
    font-size: 20px;
    min-width: 24px;
    text-align: center;
}

.nav-text {
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 10px;
}

.sidebar.collapsed .nav-item.active {
    padding-left: 10px;
    border-left: none;
    border-right: 3px solid var(--accent);
}

/* Logout button special styling */
.nav-logout {
    font-family: 'Conthrax', sans-serif;
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: var(--line);
    margin: 12px 20px;
}

.sidebar.collapsed .sidebar-divider {
    margin: 12px 10px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 920px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
        width: 260px;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        animation: fadeIn 0.3s ease forwards;
    }

    @keyframes fadeIn {
        to {
            opacity: 1;
        }
    }
}

/* 13. Utility Classes
   ========================================================================== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--muted);
}

.text-error {
    color: var(--error);
}

.text-success {
    color: var(--success);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 24px; }

.p-1 { padding: 8px; }
.p-2 { padding: 12px; }
.p-3 { padding: 16px; }
.p-4 { padding: 20px; }
.p-5 { padding: 24px; }

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 20px; }

/* 14. Scrollbar Customization
   ========================================================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: rgba(25, 211, 255, .2);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(25, 211, 255, .3);
}

/* 15. Blazor Error Boundary
   ========================================================================== */
.blazor-error-boundary {
    background: linear-gradient(135deg, rgba(255, 77, 77, .2), rgba(255, 77, 77, .1));
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    position: relative;
}

.blazor-error-boundary::before {
    content: "⚠";
    position: absolute;
    left: 1rem;
    font-size: 1.8rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* 16. Loading States
   ========================================================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(25, 211, 255, .3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 17. Focus States
   ========================================================================== */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

h1:focus {
    outline: none;
}

/* 18. Print Styles
   ========================================================================== */
@media print {
    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ddd;
        background: white;
        box-shadow: none;
    }

    .btn {
        display: none;
    }
}

.dark-theme .btn-outline-primary,
.dark-theme .btn-outline-secondary,
.dark-theme .btn-outline-success {
    color: #e9ecef;
}

.dark-theme .btn-outline-primary:hover,
.dark-theme .btn-outline-secondary:hover,
.dark-theme .btn-outline-success:hover {
    color: #fff;
}

.dark-theme .alert-info {
    background-color: #1a4d6d;
    border-color: #1f5c7f;
    color: #b8daff;
}

.dark-theme .alert-danger {
    background-color: #6d1a1a;
    border-color: #7f1f1f;
    color: #ffb8b8;
}

.dark-theme .breadcrumb {
    background-color: transparent;
}

.dark-theme .breadcrumb-item a {
    color: #6ea8fe;
}

.dark-theme .nav-tabs .nav-link {
    color: #adb5bd;
}

.dark-theme .nav-tabs .nav-link.active {
    background-color: #2d2d2d;
    color: #e9ecef;
    border-color: #404040 #404040 #2d2d2d;
}

.dark-theme .badge {
    color: #fff;
}

.theme-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}