/* ============================================
   DASHBOARD LAYOUT SYSTEM
   ============================================ */

/* CSS Variables for consistent spacing */
:root {
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
    
    --panel-bg: rgba(0, 0, 0, 0.35);
    --panel-bg-solid: rgba(30, 30, 30, 0.95);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
}

/* Background Readability Overlay for Dashboard Pages */
body.page-dashboard::before,
body.page-my-profile::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 0;
    pointer-events: none;
}

body.page-dashboard > *,
body.page-my-profile > * {
    position: relative;
    z-index: 1;
}

/* Container - Max Width Centered */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    width: 100%;
}

@media (min-width: 768px) {
    .dashboard-container {
        padding: 0 var(--space-6);
    }
}

/* Dashboard Grid Layout */
.dashboard {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-5);
    padding: var(--space-6) 0;
    min-height: 60vh;
}

@media (max-width: 767px) {
    .dashboard {
        grid-template-columns: 1fr;
        gap: var(--space-4);
        padding: var(--space-4) 0;
    }
}

/* Dashboard Sidebar */
.dashboard__sidebar {
    position: relative;
}

@media (min-width: 768px) {
    .dashboard__sidebar {
        position: sticky;
        top: var(--space-6);
        align-self: start;
        max-height: calc(100vh - var(--space-8));
        overflow-y: auto;
    }
}

/* Dashboard Main Content */
.dashboard__main {
    min-width: 0; /* Prevents grid overflow */
}

/* Page Header */
.dashboard__header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.dashboard__header h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 767px) {
    .dashboard__header h1 {
        font-size: 1.5rem;
    }
}

/* ============================================
   USER CARD (SIDEBAR)
   ============================================ */

.user-card {
    background: var(--panel-bg-solid);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card__avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-card__name {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.user-card__meta {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.user-card__meta-item {
    margin-bottom: var(--space-1);
}

.user-card__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card__action:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   PANEL COMPONENTS
   ============================================ */

.panel {
    background: var(--panel-bg-solid);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--space-5);
    overflow: hidden;
}

.panel__header {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.panel__title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--space-2);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: var(--space-2);
}

.panel__body {
    padding: var(--space-5);
}

.panel__empty {
    text-align: center;
    padding: var(--space-8) var(--space-5);
    color: var(--text-secondary);
}

.panel__empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.panel__empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.panel__empty-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
}

.panel__empty-action {
    display: inline-block;
    padding: var(--space-3) var(--space-5);
    background: #e55c5c;
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.2s ease;
}

.panel__empty-action:hover {
    background: #d44c4c;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   SUBMITTED LINKS TABLE
   ============================================ */

.submitted-links-table {
    width: 100%;
    border-collapse: collapse;
}

.submitted-links-table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.submitted-links-table td {
    padding: var(--space-4);
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.submitted-links-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.submitted-links-table__name {
    color: var(--text-primary);
    font-weight: 500;
}

.submitted-links-table__name a {
    color: var(--text-primary);
    text-decoration: none;
}

.submitted-links-table__name a:hover {
    color: #e55c5c;
    text-decoration: underline;
}

.submitted-links-table__status {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.submitted-links-table__status--pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.submitted-links-table__status--approved {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.submitted-links-table__status--rejected {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.submitted-links-table__actions {
    display: flex;
    gap: var(--space-2);
}

.submitted-links-table__action {
    padding: var(--space-1) var(--space-3);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.submitted-links-table__action:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-decoration: none;
}

@media (max-width: 767px) {
    .submitted-links-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .submitted-links-table th,
    .submitted-links-table td {
        min-width: 120px;
    }
}

/* ============================================
   FAVORITES GRID
   ============================================ */

.favorites-grid,
.reviews-grid.reviews-list {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: start;
}

.reviews-grid.reviews-list {
    gap: 1.5rem;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .favorites-grid,
    .reviews-grid.reviews-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .favorites-grid,
    .reviews-grid.reviews-list {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
}

.favorite-card {
    background: var(--panel-bg-solid);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.favorite-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.2);
}

.favorite-card__thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.favorite-card__thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-card__body {
    padding: var(--space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.favorite-card__title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--space-3) 0;
    line-height: 1.4;
    flex: 1;
}

.favorite-card__title a {
    color: var(--text-primary);
    text-decoration: none;
}

.favorite-card__title a:hover {
    color: #e55c5c;
    text-decoration: underline;
}

.favorite-card__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.favorite-card__button {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    background: #e55c5c;
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.favorite-card__button:hover {
    background: #d44c4c;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.favorite-card__button--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.favorite-card__button--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.favorite-card__icons {
    display: flex;
    gap: var(--space-2);
    margin-left: var(--space-2);
}

.favorite-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

.favorite-card__icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-decoration: none;
    transform: scale(1.1);
}

/* Ensure minimum tap target size on mobile */
@media (max-width: 767px) {
    .favorite-card__button,
    .favorite-card__icon {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   HEADER ALIGNMENT FOR DASHBOARD PAGES
   ============================================ */

/* Align header content with dashboard container */
body.page-dashboard #header .wrapper,
body.page-my-profile #header .wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    body.page-dashboard #header .wrapper,
    body.page-my-profile #header .wrapper {
        padding: 0 var(--space-6);
    }
}

/* Ensure Submit Link button is properly contained */
body.page-dashboard #header .submit-col,
body.page-my-profile #header .submit-col {
    position: relative;
}

/* Profile page: hide duplicate avatar in top network bar */
body.page-my-profile #network .avatar-img,
body.page-my-profile #network .avatar-img img {
    display: none !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
