/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.nav-container {
    width: 100%;
    max-width: var(--container-width);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    height: 18px;
    /* Was 16px */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links a:not(.btn) {
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav-links a:not(.btn):hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.nav-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.primary {
    background: var(--oracle-red);
    border-color: var(--oracle-red);
    color: white;
}

.nav-btn.primary:hover {
    background: #b03020;
    border-color: #b03020;
    box-shadow: 0 0 10px rgba(199, 70, 52, 0.3);
}

.nav-btn svg {
    opacity: 0.8;
}

/* Glassmorphism Red Button (Bright & High Performance) */
.btn-glass-red {
    background: rgba(255, 60, 40, 0.85);
    /* Highly vibrant and opaque */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 25px rgba(255, 60, 40, 0.5);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.btn-glass-red:hover {
    background: rgba(255, 40, 20, 1);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(255, 60, 40, 0.7);
    color: white;
}

.btn-glass-red:active {
    transform: translateY(0);
}

/* Edit Button in Card */
.btn-edit-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.btn-edit-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--oracle-red);
    box-shadow: 0 0 10px var(--oracle-red);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0;
    position: relative;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, var(--oracle-red-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    min-height: 1.6em;
    /* Prevent layout shift */
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    transition: var(--transition-normal);
}

.search-input:focus {
    outline: none;
    border-color: var(--oracle-red);
    box-shadow: 0 0 20px rgba(199, 70, 52, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px 30px;
    border-radius: 16px;
    text-align: center;
    min-width: 160px;
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: var(--oracle-red);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--oracle-red-light);
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filter Bar */
.sticky-wrapper {
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    padding: 20px 0;
    margin: 0 -20px;
    /* Counteract main padding to go full width */
    padding-left: 20px;
    padding-right: 20px;
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(24px);
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 10px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
}

select:hover,
select:focus {
    border-color: var(--oracle-red);
    color: var(--text-primary);
}

select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    background: rgba(199, 70, 52, 0.2);
    border: 1px solid rgba(199, 70, 52, 0.3);
    color: var(--oracle-red-light);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-chip:hover {
    background: rgba(199, 70, 52, 0.3);
    border-color: var(--oracle-red);
}

.results-count {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 500;
}

/* Demo Grid */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
    min-height: 400px;
}

.demo-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--oracle-red), transparent);
    opacity: 0;
    transition: var(--transition-normal);
}

.demo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(199, 70, 52, 0.3);
}

.demo-card:hover::before {
    opacity: 1;
}

.card-thumb {
    height: 250px;
    /* Increased from 210px */
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    /* Align to top left as requested */
    transition: transform 0.6s ease;
}

.demo-card:hover .card-thumb img {
    transform: scale(1.05);
}

.card-status {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.demo-card .card-status.status-visible {
    background-color: #2563EB !important;
    /* Royal Blue */
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(8px);
}

.demo-card .card-status.status-visible .status-dot {
    background-color: #FFFFFF !important;
    box-shadow: 0 0 10px #FFFFFF;
}

.demo-card .card-status.status-prototype {
    background-color: #EA580C !important;
    /* Orange */
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(8px);
}

.demo-card .card-status.status-prototype .status-dot {
    background-color: #FFFFFF !important;
    box-shadow: 0 0 10px #FFFFFF;
}

.demo-card .card-status.status-mvp {
    background-color: #16A34A !important;
    /* Green */
    color: #FFFFFF !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    backdrop-filter: blur(8px);
}

.demo-card .card-status.status-mvp .status-dot {
    background-color: #FFFFFF !important;
    box-shadow: 0 0 10px #FFFFFF;
}

.card-status.status-mvp .status-dot {
    background-color: #ffffff !important;
    box-shadow: 0 0 10px #ffffff;
}

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--oracle-red-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
    line-height: 1.3;
}

.card-customer {
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-bottom: 12px;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.pill {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

.card-action {
    margin-top: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-normal);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(90deg, var(--oracle-red-dark) 0%, var(--oracle-red) 100%);
    box-shadow: 0 4px 12px rgba(199, 70, 52, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: #C74634;
    color: white;
}

.btn-danger:hover {
    background: #A0382A;
}

.btn:hover {
    box-shadow: 0 0 20px rgba(199, 70, 52, 0.4);
    transform: translateY(-2px);
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--oracle-red);
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Customer Tag */
.pill-customer {
    background: rgba(59, 130, 246, 0.2);
    /* Accent Blue tint */
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-weight: 500;
}

/* Logo Branding */
.logo-separator {
    color: var(--glass-border);
    font-weight: 300;
    margin: 0 4px;
    font-size: 1.4rem;
}

.brand-text {
    font-family: 'Outfit', sans-serif;
    /* Ensuring sleek font */
    font-weight: 600;
    /* Jatupong weight */
    color: #fff;
    letter-spacing: -0.5px;
}

.brand-text .gradient-text {
    background: linear-gradient(to right, var(--oracle-red) 0%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.brand-accent {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--oracle-red);
    color: #ffffff;
    font-weight: 700;
    font-style: normal;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.5em;
    text-transform: uppercase;
    letter-spacing: 1px;
    vertical-align: middle;
    margin-left: 6px;
    position: relative;
    top: -4px;
    /* Reset gradient text effects */
    -webkit-text-fill-color: initial;
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

/* Fine-tune the height */


/* Fix Logo Separator Visibility */
.logo-separator {
    color: rgba(255, 255, 255, 0.6) !important;
    /* Make it much brighter */
    font-weight: 400 !important;
    /* Make it thicker */
    margin: 0 8px;
    /* Give it more breathing room */
}

/* Rearrange Mode */
.rearrange-mode .demo-card {
    cursor: grab;
    border: 2px dashed var(--oracle-red);
    transform: scale(0.95);
    position: relative;
    z-index: 100;
}

.rearrange-mode .demo-card::after {
    content: '::: Drag to Reorder';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(199, 70, 52, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    pointer-events: none;
    z-index: 101;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.rearrange-mode .demo-card:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--oracle-red);
}

.sortable-drag {
    cursor: grabbing;
    opacity: 0;
    /* Hide the original element while dragging if using native, but with forceFallback the original stays and ghost is used */
}

/* Fallback Dragging Style (Smooth JS Drag) */
.sortable-fallback {
    opacity: 1 !important;
    background: var(--bg-surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(1.02);
    border: 2px solid var(--oracle-red);
    cursor: grabbing;
    pointer-events: none;
    /* Let events pass manual drag */
    z-index: 99999 !important;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 50px;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.95rem;
}

.toast-success i {
    color: var(--accent-green);
}

.toast-error i {
    color: var(--oracle-red);
}

/* Custom Filter Dropdowns */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C74634' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    /* Space for the arrow */
    font-size: 0.95rem;
    font-weight: 500;
}

select option {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    padding: 12px;
}