/* ==========================================================================
   FILE: css/dashboard.css
   DESCRIPTION: User Dashboard Styles for JEENASH STORE
   UI/UX: Premium Dark Theme, Refined Cards, Responsive Library Grid
   ========================================================================== */

/* ==========================================================
   DASHBOARD BASE LAYOUT
   ========================================================== */

.dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-base);
}

.dashboard-header {
    padding: 120px 0 2rem 0;
    z-index: 10;
    position: relative;
}

/* ==========================================================
   PREMIUM WELCOME BANNER
   ========================================================== */

.premium-welcome-card {
    background: linear-gradient(145deg, rgba(109, 40, 217, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.premium-welcome-card:hover {
    border-color: rgba(139, 92, 246, 0.2);
}

.welcome-text h1 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 0.25rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin: 0;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-fast);
}

.stat-box:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.12);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 60px;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

/* ==========================================================
   DASHBOARD CONTENT
   ========================================================== */

.dashboard-content {
    flex-grow: 1;
    padding-bottom: 4rem;
}

.section-title-wrap {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 1rem;
}

.section-title {
    font-size: clamp(1.5rem, 2.5vw, 1.8rem);
    font-weight: 700;
    margin: 0;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

/* ==========================================================
   LIBRARY GRID
   ========================================================== */

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

/* ==========================================================
   DASHBOARD CARDS
   ========================================================== */

.dash-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
}

.dash-card:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Card Image */
.card-img-wrap {
    width: 100%;
    aspect-ratio: 16/10;
    position: relative;
    overflow: hidden;
    background: var(--bg-base);
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.dash-card:hover .card-img-wrap img {
    transform: scale(1.04);
}

/* Unlock Badge */
.unlock-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Card Body */
.card-body {
    padding: 1.25rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--font-body);
    min-height: 2.6rem;
}

/* Drive Access Button */
.btn-drive {
    width: 100%;
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 44px;
}

.btn-drive:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn-drive:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-drive:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================================
   SKELETON LOADERS
   ========================================================== */

.skeleton {
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.04);
}

.skel-img {
    width: 100%;
    aspect-ratio: 16/10;
    background: rgba(255, 255, 255, 0.04);
    animation: shimmer 1.8s ease-in-out infinite;
}

.skel-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skel-line {
    height: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skel-line:first-child {
    height: 1.2rem;
    width: 80%;
}

.skel-btn {
    width: 100%;
    height: 2.75rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.skel-img,
.skel-line,
.skel-btn {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
}

/* ==========================================================
   EMPTY STATE
   ========================================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-glass);
    border-radius: var(--radius-lg);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.empty-state p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
    font-size: 1rem;
}

.empty-state .btn {
    margin-top: 1.5rem;
    border-radius: var(--radius-full);
    padding: 0.75rem 2rem;
    min-height: 48px;
}

/* ==========================================================
   HIDDEN UTILITY
   ========================================================== */

.hidden {
    display: none !important;
}

/* ==========================================================
   ANIMATIONS
   ========================================================== */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-card {
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .dash-card {
        animation: none !important;
        opacity: 1 !important;
    }
    
    .dash-card:hover {
        transform: none !important;
    }
    
    .dash-card:hover .card-img-wrap img {
        transform: none !important;
    }
    
    .skel-img,
    .skel-line,
    .skel-btn {
        animation: none !important;
    }
}

/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */

/* Tablet and smaller */
@media (max-width: 1024px) {
    .dashboard-header {
        padding: 110px 0 1.5rem 0;
    }
    
    .premium-welcome-card {
        padding: 2rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .stat-box {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 100px 0 1rem 0;
    }
    
    .premium-welcome-card {
        padding: 1.5rem;
        border-radius: var(--radius-md);
        gap: 1.25rem;
    }
    
    .welcome-text h1 {
        font-size: 1.6rem;
    }
    
    .welcome-text p {
        font-size: 0.9rem;
    }
    
    .stat-box {
        padding: 0.6rem 1rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-num {
        font-size: 1.25rem;
    }
    
    /* 🔴 2 CARDS PER ROW ON MOBILE */
    .orders-grid:not(.hidden) {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .dash-card {
        border-radius: var(--radius-sm) !important;
    }
    
    .card-img-wrap {
        aspect-ratio: 1/1;
    }
    
    .unlock-badge {
        font-size: 0.5rem;
        padding: 0.2rem 0.4rem;
        top: 0.4rem;
        right: 0.4rem;
        border-radius: 4px;
    }
    
    .card-body {
        padding: 0.6rem !important;
        gap: 0.5rem !important;
    }
    
    .card-title {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
        min-height: 1.6rem;
        -webkit-line-clamp: 2;
    }
    
    .btn-drive {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.6rem !important;
        border-radius: 6px !important;
        min-height: 32px !important;
        gap: 4px !important;
    }
    
    .btn-drive i {
        font-size: 0.5rem !important;
    }
    
    /* Skeleton mobile */
    .skel-img {
        aspect-ratio: 1/1;
    }
    
    .skel-body {
        padding: 0.6rem;
        gap: 0.5rem;
    }
    
    .skel-line {
        height: 0.7rem;
    }
    
    .skel-line:first-child {
        height: 0.8rem;
        width: 80%;
    }
    
    .skel-btn {
        height: 2rem;
        border-radius: 6px;
    }
    
    .section-title-wrap {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .empty-state {
        padding: 2.5rem 1.5rem;
        grid-column: 1 / -1;
    }
    
    .empty-icon {
        font-size: 2.5rem;
    }
    
    .empty-state h3 {
        font-size: 1.2rem;
    }
    
    .empty-state p {
        font-size: 0.9rem;
    }
    
    .empty-state .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.85rem;
        min-height: 42px;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 90px 0 0.75rem 0;
    }
    
    .premium-welcome-card {
        padding: 1.25rem;
        border-radius: var(--radius-sm);
    }
    
    .welcome-text h1 {
        font-size: 1.3rem;
    }
    
    .welcome-text p {
        font-size: 0.8rem;
    }
    
    .stat-box {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }
    
    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    
    .stat-num {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
        letter-spacing: 0.5px;
    }
    
    .orders-grid:not(.hidden) {
        gap: 0.5rem !important;
    }
    
    .card-body {
        padding: 0.4rem !important;
        gap: 0.4rem !important;
    }
    
    .card-title {
        font-size: 0.6rem !important;
        min-height: 1.4rem;
    }
    
    .btn-drive {
        font-size: 0.5rem !important;
        padding: 0.3rem 0.4rem !important;
        min-height: 28px !important;
        border-radius: 4px !important;
    }
    
    .btn-drive i {
        font-size: 0.4rem !important;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .orders-grid:not(.hidden) {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2.5rem;
    }
}