/* VIZORA User Dashboard Specific CSS */

.app-body { overflow: hidden; }

.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-primary);
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
}
.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-soft);
}
.letter-spacing-1 { letter-spacing: 0.05em; }

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}
.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; color: var(--text-secondary);
    border-radius: var(--radius-sm); font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s ease; margin-bottom: 0.25rem;
    text-decoration: none; width: 100%; border: none; background: transparent; text-align: left;
}
.nav-item i { width: 20px; text-align: center; font-size: 1.1rem; }
.nav-item:hover { background-color: var(--bg-primary); color: var(--text-primary); }
.nav-item.active { background-color: var(--accent-soft); color: var(--accent-primary); }
.nav-item-primary { color: var(--text-primary); }
.nav-item-primary:hover { background-color: var(--accent-soft); }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border-soft); }

/* Main Content */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

.app-header {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem; flex-shrink: 0; z-index: 50;
}

.app-content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    position: relative;
    background-color: var(--bg-primary);
}

.max-w-container { max-width: 1200px; }
.pb-6 { padding-bottom: 5rem; }

/* Views */
.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utilities */
.cursor-pointer { cursor: pointer; }
.bg-gradient-to-r { background: linear-gradient(90deg, var(--bg-primary) 0%, transparent 100%); }

/* Visualize Workflow */
.max-w-workflow { max-width: 800px; }
.wf-step { display: none; animation: fadeIn 0.3s ease; }
.wf-step.active { display: block; }

.step-tr {
    color: var(--text-secondary);
    opacity: 0.5;
    transition: all 0.3s ease;
}
.step-tr.active {
    color: var(--text-primary);
    opacity: 1;
}
.step-tr.active .v-badge { background-color: var(--accent-primary); color: #FFF; }

.border-dashed { border: 2px dashed var(--border-color); }
.border-blue { border-color: var(--accent-primary) !important; }
.border-copper { border-color: var(--accent-copper) !important; }
.text-sm { font-size: 0.875rem; }

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* History Card */
.hist-card {
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex; flex-direction: column;
}
.hist-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--accent-soft); }
.hist-img { aspect-ratio: 16/9; background: var(--bg-elevated); position: relative; }
.hist-img img { width: 100%; height: 100%; object-fit: cover; }
.hist-badge { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 0.65rem; background: rgba(0,0,0,0.7); color: #FFF; padding: 0.2rem 0.6rem; border-radius: 99px; font-weight: 700; backdrop-filter: blur(4px); text-transform: uppercase; }
.hist-badge.completed { background: rgba(16, 185, 129, 0.9); }
.hist-badge.failed { background: rgba(239, 68, 68, 0.9); }
.hist-info { padding: 1rem; flex-grow: 1; }
.hist-title { font-weight: 700; margin-bottom: 0.25rem; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.hist-meta { font-size: 0.75rem; color: var(--text-secondary); display: flex; justify-content: space-between; }
.hist-actions { padding: 0.75rem 1rem; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; background: var(--bg-primary); }

/* Transactions */
.tx-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-soft); }
.tx-item:last-child { border-bottom: none; }
.tx-desc { font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.9rem; }
.tx-date { font-size: 0.75rem; color: var(--text-secondary); }
.tx-amt { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; }
.tx-amt.pos { color: #10B981; }

/* Pricing Transition */
.price-trans { transition: opacity 0.2s ease; }

/* Toast Customization */
.app-toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-weight: 600; font-family: 'DM Sans', sans-serif;
    display: flex; align-items: center; gap: 0.75rem;
    margin-top: 0.5rem;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.app-toast.success i { color: #10B981; }
.app-toast.error i { color: #EF4444; }
.app-toast.info i { color: var(--accent-primary); }
.app-toast.fade-out { opacity: 0; transform: translateX(100%); }

@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }

/* Mobile Utilities */
.mobile-only { display: none !important; }
.hide-mobile { display: flex; }

/* Bottom Nav */
.app-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-surface); border-top: 1px solid var(--border-color);
    z-index: 100; padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0.5rem 0; color: var(--text-secondary); font-size: 0.65rem; font-weight: 700;
    text-decoration: none; font-family: 'Plus Jakarta Sans', sans-serif;
    transition: color 0.2s ease;
}
.bnav-item i { font-size: 1.1rem; }
.bnav-item.active { color: var(--accent-primary); }
.bnav-item.create-btn { position: relative; color: var(--text-primary); }
.create-orb {
    width: 44px; height: 44px; border-radius: 50%; background: var(--accent-primary); color: #FFF;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
    margin-bottom: 0.1rem; transform: translateY(-10px);
}

/* Result Visualization Image Container */
.res-image-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.res-image-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--bg-elevated);
    border-radius: 14px;
    overflow: hidden;
    display: block;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border-soft);
}

.res-image-element {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 14px;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s ease;
    opacity: 0;
}

.res-image-element.loaded {
    opacity: 1;
}

/* Skeleton Loading State with subtle shimmer */
.res-image-skeleton {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 0%,
        var(--bg-primary) 50%,
        var(--bg-elevated) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite linear;
    z-index: 2;
    padding: 1.5rem;
    text-align: center;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.res-image-skeleton .skeleton-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--border-soft);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 1rem;
}

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

/* Error & Expired States in Result Container */
.res-image-overlay-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    padding: 2rem 1.5rem;
    text-align: center;
    z-index: 3;
}

.res-image-overlay-state.d-none {
    display: none !important;
}

.res-image-overlay-state .state-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.res-image-overlay-state .state-icon.error {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

.res-image-overlay-state .state-icon.expired {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

.res-badge-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.res-badge-wrap .v-badge {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    font-weight: 700;
    border-radius: 99px;
}

/* Responsive */
@media (max-width: 991px) {
    .max-w-workflow { max-width: 100%; }
}

@media (max-width: 767px) {
    .app-sidebar { display: none; }
    .mobile-only { display: flex !important; }
    .hide-mobile { display: none !important; }
    .app-main { height: calc(100vh - 60px); } /* Account for bottom nav */
    .app-bottom-nav { display: flex; }
    .w-full-mobile { width: 100%; }
    .pb-6 { padding-bottom: 2rem; }
    
    .create-banner { text-align: center; }
    .create-banner .row { flex-direction: column; }
    
    .view-container { padding: 1rem; }

    /* Mobile 4/3 Aspect Ratio for Result Visualization */
    .res-image-stage {
        aspect-ratio: 4 / 3;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    .res-image-element {
        border-radius: 12px;
    }
    .res-image-card {
        padding: 0.875rem;
    }
    .res-actions-wrap {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .res-actions-wrap .v-btn {
        width: 100% !important;
        margin-right: 0 !important;
    }
}
