/* Global responsive header and mobile navigation */

.app-header {
    position: relative;
}

/* Mobile hamburger */
.mobile-hamburger {
    display: none;
    -webkit-app-region: no-drag;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mobile-hamburger:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}
.mobile-hamburger.active {
    color: #a78bfa; /* purple-400 */
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.25);
}

/* Off-canvas shared styles */
.offcanvas-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10002;
}
.offcanvas-panel {
    position: fixed;
    top: 0;
    height: 100%;
    width: 288px; /* w-72 */
    background: #f9fafb;
    color: #0f172a;
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 18px 50px rgba(0,0,0,0.20);
    padding: 20px;
    z-index: 10003;
    transform: translateX(0);
    transition: transform 0.3s ease;
    -webkit-overflow-scrolling: touch;
}
.offcanvas-left {
    left: 0;
    transform: translateX(-100%);
}
.offcanvas-right {
    right: 0;
    transform: translateX(100%);
}
.offcanvas-panel.open.offcanvas-left,
.offcanvas-panel.open.offcanvas-right {
    transform: translateX(0);
}
.offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.offcanvas-header h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.offcanvas-close {
    color: rgba(17,24,39,0.8);
    background: transparent;
    border: 1px solid rgba(17,24,39,0.12);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}
.offcanvas-close:hover {
    background: rgba(17,24,39,0.06);
}
.offcanvas-user-summary {
    margin: 6px 0 10px;
}
.offcanvas-user-summary .name {
    font-weight: 700;
}
.offcanvas-user-summary .meta {
    font-size: 12px;
    color: rgba(17,24,39,0.7);
}
.offcanvas-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}
.offcanvas-nav a,
.offcanvas-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(17, 24, 39, 0.08);
    color: rgba(17,24,39,0.9);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.offcanvas-nav a:hover,
.offcanvas-action:hover {
    background: rgba(17, 24, 39, 0.08);
    border-color: rgba(17, 24, 39, 0.12);
}
.offcanvas-action.danger {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}
.offcanvas-nav i {
    width: 18px;
    text-align: center;
}

/* Bottom sheet (account) */
.sheet-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 75vh;
    background: #ffffff;
    color: #0f172a;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -20px 40px rgba(0,0,0,0.15);
    z-index: 10004;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    -webkit-overflow-scrolling: touch;
}
.sheet-panel.open {
    transform: translateY(0);
}
.sheet-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sheet-handle {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(0,0,0,0.15);
}
.sheet-title {
    font-weight: 700;
}
.sheet-close {
    color: rgba(17,24,39,0.8);
    background: transparent;
    border: 1px solid rgba(17,24,39,0.12);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}
.sheet-user {
    padding: 8px 14px;
}
.sheet-user .name { font-weight: 700; }
.sheet-user .meta { font-size: 12px; color: rgba(17,24,39,0.65); }
.sheet-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 14px 16px;
}
.sheet-nav a, .sheet-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(17, 24, 39, 0.08);
    color: rgba(17,24,39,0.9);
    text-decoration: none;
}
.sheet-action.danger {
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}
.sheet-nav i { width: 18px; text-align:center; }

@media (max-width: 768px) {
    .mobile-hamburger {
        display: inline-flex;
    }
    /* keep desktop features hidden on mobile */
    .nav-features {
        display: none;
    }
}

/* ======================================================================
   Moved from templates/base.html — Portfolio Widget Styles
   ====================================================================== */
.portfolio-widget-container {
    position: relative;
}

.portfolio-widget-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.portfolio-widget-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.portfolio-widget-btn.has-investment {
    background: rgba(236, 72, 153, 0.2);
}

.portfolio-icon {
    font-size: 1.2rem;
}

.portfolio-amount {
    font-weight: 600;
    font-size: 0.9rem;
}

.portfolio-label {
    font-size: 0.875rem;
}

.portfolio-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    max-width: 400px;
    z-index: 1000;
    overflow: hidden;
}

.portfolio-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.portfolio-dropdown-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.portfolio-view-all {
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.portfolio-view-all:hover {
    text-decoration: underline;
}

.portfolio-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.portfolio-empty p {
    margin: 0.5rem 0;
}

.portfolio-empty .text-muted {
    font-size: 0.875rem;
    opacity: 0.7;
}

.portfolio-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.portfolio-total-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.portfolio-total-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #059669;
}

.portfolio-artists-list {
    padding: 0.5rem;
}

.portfolio-artist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.portfolio-artist-item:hover {
    background: #f9fafb;
}

.portfolio-artist-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.portfolio-artist-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.portfolio-artist-amount {
    font-size: 0.75rem;
    color: #059669;
    font-weight: 500;
}

.portfolio-boost-btn {
    padding: 0.375rem 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.portfolio-boost-btn:hover {
    background: #5568d3;
}

@media (max-width: 768px) {
    .portfolio-dropdown {
        right: auto;
        left: 0;
        min-width: 280px;
    }
}

/* ======================================================================
   Moved from templates/base.html — Image Loading Styles
   ====================================================================== */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded {
    opacity: 1;
}

img[data-src].error {
    opacity: 1;
}

/* Prevent images from loading until Alpine.js processes them */
.image-placeholder {
    background: #f0f0f0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder:not([src]) {
    background: #e0e0e0;
}

.image-placeholder[src] {
    background: none;
}

/* Prevent multiple identical images from loading */
img[src*="default-cover.jpg"] {
    max-width: 100%;
    height: auto;
}

/* Collection badge styling */
[data-collection-badge] {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    border-radius: 9999px;
    padding: 3px 8px;
    font-weight: 600;
}
