/* assets/css/style.css - Main Landing Page & General Styles */
:root,
[data-theme="dark"] {
    /* Default Dark Theme */
    --primary-color: #6366f1;
    --primary-rgb: 99, 102, 241;
    --primary-hover: #4f46e5;
    --secondary-color: #f8fafc;
    --accent-color: #00b4ff;
    --bg-color: #0f172a;
    --bg-rgb: 15, 23, 42;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-bg-rgb: 30, 41, 59;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --nav-bg: rgba(15, 23, 42, 0.8);
}

:root[data-theme="light"] {
    --bg-color: #f8fafc;
    --bg-rgb: 248, 250, 252;
    --card-bg: #ffffff;
    --card-bg-rgb: 255, 255, 255;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --primary-color: #4f46e5;
    --primary-rgb: 79, 70, 229;
    --accent-color: #0ea5e9;
    --border-color: #e2e8f0;
    --nav-bg: rgba(255, 255, 255, 0.9);
}

:root[data-theme="blue"] {
    --bg-color: #001e3c;
    --bg-rgb: 0, 30, 60;
    --card-bg: rgba(0, 43, 85, 0.7);
    --card-bg-rgb: 0, 43, 85;
    --text-primary: #e6f1ff;
    --text-secondary: #b1d1f0;
    --primary-color: #3399ff;
    --primary-rgb: 51, 153, 255;
    --accent-color: #66b2ff;
    --border-color: rgba(51, 153, 255, 0.2);
    --nav-bg: rgba(0, 30, 60, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Hide scrollbars globally */
*::-webkit-scrollbar {
    display: none;
}
* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hide number input spin buttons */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

body {
    font-family: 'Inter', 'Prompt', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    animation: fadeIn 0.5s ease-out forwards;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.modal-open {
    overflow: hidden !important;
    height: 100vh;
}

/* Drag and Drop Styles */
.bom-row-dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.2) !important;
    border: 2px dashed var(--primary-color) !important;
}

.bom-row-over {
    border-top: 3px solid var(--primary-color) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.bom-row:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

.bom-row:active {
    cursor: grabbing !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.main-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    min-height: calc(100vh - 160px); /* Adjust for navbar and footer */
}

/* Footer Styles */
.footer {
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 1rem;
    margin-top: auto;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.footer .copyright {
    color: var(--text-primary);
    font-weight: 500;
}

.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }

/* Scroll-top button (Disabled per user choice, style moved to nav) */
.scroll-top-btn {
    display: none;
}

.dashboard-header,
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.fade-out {
    opacity: 0 !important;
    transform: translateY(-5px) !important;
    transition: all 0.3s ease-in !important;
}

.theme-select {
    outline: none;
    transition: all 0.2s ease;
}

.theme-select:hover {
    border-color: var(--primary-color) !important;
}

/* Nav Bar */
.main-nav, .navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 1000;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 0;
}

/* Sticky Header State - Floating Glassmorphism Bar */
.main-nav.scroll-top,
.navbar.scroll-top {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1400px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-sizing: border-box;
}

.navbar.scroll-top .nav-container {
    padding: 0.25rem 1.5rem;
    max-width: 100%;
}

.main-nav.scroll-top .nav-container,
.navbar.scroll-top .nav-container {
    width: 100%;
    padding: 0.5rem 2.5rem;
    height: 100%;
    display: flex;
    align-items: center;
}

@keyframes navSlideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Fix for floating navbar */
.navbar.scroll-top .user-dropdown-menu {
    top: calc(100% + 5px);
    right: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    visibility: hidden;
    opacity: 0;
    right: 30px;
    bottom: 30px;
    z-index: 9999;
    background: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 15px;
    color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    backdrop-filter: blur(8px);
}

.scroll-top-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-5px);
    color: white;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.scroll-top-btn.active {
    visibility: visible;
    opacity: 1;
}

.scroll-top-btn i {
    width: 24px;
    height: 24px;
}

/* Premium Spinner */
.premium-spinner-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.2;
    animation: pulse 1.5s ease-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

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

.nav-container {
    width: 100%;
    max-width: none;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.nav-logo img {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
/* Drag and Drop Reordering */
.draggable-row {
    cursor: default;
    transition: background 0.2s ease;
}

.draggable-row.dragging {
    opacity: 0.4;
    background: var(--primary-color) !important;
}

.drag-handle {
    width: 40px;
    text-align: center;
    padding: 0 !important;
}

.drag-handle i {
    cursor: grab;
}

.dragging .drag-handle i {
    cursor: grabbing;
}
.nav-logo i {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-left: auto;
    padding: 0.25rem 0;
}
.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    height: 100%;
}

.card-body {
    padding: 1.5rem;
    width: 100%;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 1.25rem;
    width: 100%;
    padding: 0 0.5rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-dropdown-toggle:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    min-width: 220px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 0.75rem;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
    animation: dropdownSlide 0.3s ease-out;
}

.user-dropdown-menu.active {
    display: flex;
}

/* Bridge to prevent closing when moving mouse from toggle to menu */
.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.user-dropdown:hover .user-dropdown-menu {
    display: flex;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0.5rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: calc(100vh - 73px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

/* Animated Background */
.background-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -10%;
    right: -10%;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #2563eb;
    top: 40%;
    right: 30%;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 100px) scale(1.2);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    max-width: 600px;
    margin-inline: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    width: 30px;
    height: 30px;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: white;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.action-area {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 3rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.action-area h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-area p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* =========================================
   PREMIUM FORM STYLES (Shared)
========================================= */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: relative;
    margin-bottom: 1.25rem;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group:focus-within label {
    color: var(--primary-color);
}

input,
select {
    padding: 0.85rem 1.2rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

input:hover,
select:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

select option {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 10px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        padding: 1rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    /* Keep scroll-top navbar as a row even on mobile */
    .navbar.scroll-top .nav-container,
    .main-nav.scroll-top .nav-container {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        justify-content: space-between;
        align-items: center;
    }

    .nav-links {
        width: auto;
        flex: 1;
        overflow-x: auto;
        padding-bottom: 0;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        gap: 0.75rem;
        display: flex;
        scrollbar-width: none; /* Firefox */
        align-items: center;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .auth-nav {
        width: 100%;
        justify-content: space-between;
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none !important;
        border-top: 1px solid var(--border-color);
        padding-top: 1rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .dashboard-header {
        flex-direction: row !important;
        align-items: center !important;
        gap: 1.5rem;
    }

    .header-actions {
        width: auto;
        display: flex;
        flex-direction: row;
        gap: 0.75rem;
    }

    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        width: 95% !important;
        margin: 5% auto !important;
        padding: 1.5rem !important;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Support for inline styles used in JS/HTML */
    div[style*="display: grid; grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="display: flex; flex-direction: column"] {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .nav-brand span {
        font-size: 1.1rem;
    }

    .card-header {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}