/**
 * Modern News Hub Styles - White & Blue Theme
 * Daily.dev-inspired design with performance optimizations
 */

/* Global Styles - Soft White & Blue Theme */
body.page-template-fashionresalenews {
    background: #f5f7fa !important;
    color: #1a202c !important;
}

/* Color Variables - Soft White & Blue */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f7ff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-blue-light: #dbeafe;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Base Layout - Two Column with Left Sidebar (No Right Sidebar) */
.news-hub-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px !important;
    column-gap: 24px !important;
    min-height: 100vh;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 24px 24px 24px 0;
    max-width: 100%;
    width: 100%;
}

/* Daily.dev-style Left Sidebar */
.news-hub-left-sidebar {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 260px;
    height: fit-content;
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-color) !important;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    padding: 1.5rem 0;
    box-shadow: 1px 0 3px rgba(0,0,0,0.03);
}

.sidebar-logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-logo svg {
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: #e3f2fd;
    color: #1a1a1a;
}

.nav-item.active {
    background: #e3f2fd;
    color: #007bff;
    font-weight: 600;
}

.nav-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

.sidebar-categories {
    padding: 0 0.75rem;
    margin-bottom: 1rem;
}

.sidebar-section-title {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #495057;
    margin-bottom: 0.5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.user-avatar {
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
}

/* Main Content Area - Centered Feed */
.news-hub-main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    max-width: 100%;
    width: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news-hub-header {
    margin-bottom: 2rem;
    max-width: 900px;
    width: 100%;
}

.news-hub-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.news-hub-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sort-filters {
    display: flex;
    gap: 0.5rem;
}

.sort-filter {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    color: #6c757d;
}

.sort-filter:hover {
    border-color: #007bff;
    color: #007bff;
}

.sort-filter.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

/* Single Column Layout - Extra Wide Cards */
.news-hub-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    column-gap: 24px !important;
    row-gap: 24px !important;
    margin-bottom: 2rem;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

/* Remove all spacing from anchor tags in cards */
.news-hub-grid a,
.news-card a,
.news-card-title a,
.hashtag-link {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block;
}

/* Large Rectangular Cards - Daily.dev Style */
.news-card {
    background: var(--bg-card) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    position: relative !important;
    min-height: 380px !important;
    max-height: 420px !important;
    padding: 20px;
    min-height: 200px;
    max-height: 260px;
    width: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.news-card * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.news-card::selection,
.news-card *::selection {
    background: transparent;
}

.news-card::-moz-selection,
.news-card *::-moz-selection {
    background: transparent;
}

.news-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue-light) !important;
    box-shadow: var(--shadow-md);
    background: var(--bg-hover) !important;
}

.news-card.keyboard-selected {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Card Section: Image (Middle) - Fixed height */
.news-card-image {
    width: 100% !important;
    overflow: hidden !important;
    background: var(--bg-primary) !important;
    position: relative !important;
    border-radius: 0 !important;
    flex-shrink: 0 !important;
    order: 2 !important;
}

.news-card-image img {
    width: 100% !important;
    height: 220px !important;
    object-fit: cover !important;
    transition: transform 0.2s !important;
}

.news-card:hover .news-card-image img {
    transform: scale(1.03);
}

/* Card Section 2: Content (Top) */
.news-card-content {
    order: 1 !important;
    padding: 18px 18px 12px 18px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
}

.news-card-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.news-card-title a:hover {
    color: var(--accent-blue);
}

.news-card-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: auto;
    margin-bottom: 0;
    align-items: center;
}

.news-card-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0 0;
}

.hashtag-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.8125rem;
    padding: 0.25rem 0.625rem;
    background: var(--accent-blue-light);
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.hashtag-link:hover {
    background: var(--accent-blue);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Card Section 1: Vote Controls (Left - ~48px) */
.news-card-votes {
    display: none !important; /* Hidden in card layout - votes moved to actions */
}

.news-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: auto;
}

.btn-vote {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
    color: var(--text-muted);
}

.btn-vote:hover {
    background: var(--bg-hover);
    color: var(--accent-blue);
    transform: scale(1.1);
}

.btn-upvote.active {
    background: var(--success);
    color: #ffffff;
}

.btn-downvote.active {
    background: var(--danger);
    color: #ffffff;
}

.vote-count {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--text-primary);
    min-width: 28px;
    text-align: center;
}

.btn-bookmark {
    padding: 0.25rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.2s;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-bookmark:hover {
    color: #f59e0b;
    background: #fef3c7;
    transform: scale(1.1);
}

.btn-bookmark.active {
    color: #ffc107;
    border-color: #ffc107;
}

/* Right Sidebar - Hidden for Full Width */
.news-hub-right-sidebar {
    display: none;
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.bookmarks-list,
.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bookmark-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.bookmark-item a {
    color: var(--text-primary);
    text-decoration: none;
    display: block;
}

.bookmark-item strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.bookmark-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

/* Skeleton Loaders - Large Cards */
.news-hub-skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: grid;
    grid-template-columns: 48px 1fr 180px;
    gap: 1.25rem;
    min-height: 200px;
    max-height: 260px;
    width: 100%;
}

.skeleton-votes {
    width: 48px;
    height: 120px;
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 6px;
}

.skeleton-image {
    width: 180px;
    height: 160px;
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 6px;
}

.skeleton-title {
    height: 18px;
    width: 75%;
}

.skeleton-short {
    width: 50%;
}

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

/* Load More */
.news-hub-load-more {
    text-align: center;
    margin: 2rem 0;
}

.btn-load-more {
    padding: 0.75rem 2rem;
    background: var(--accent-blue);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-load-more:hover {
    background: var(--accent-blue-hover);
}

/* Error State */
.news-hub-error {
    text-align: center;
    padding: 3rem;
    color: var(--danger);
}

/* CV Upload Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.file-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--accent-blue);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

#cv-upload-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    display: none;
}

#cv-upload-status.success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
    display: block;
}

#cv-upload-status.error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
    display: block;
}

/* Subscription Buttons */
.subscription-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-subscribe {
    padding: 0.75rem 1rem;
    background: var(--accent-blue);
    color: var(--text-primary);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-subscribe:hover {
    background: var(--accent-blue-hover);
}

.btn-subscribe:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-subscribe.subscribed {
    background: var(--success);
}

.hashtag-title {
    color: var(--accent-blue);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .news-hub-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0 !important;
        column-gap: 0 !important;
        row-gap: 0 !important;
        padding: 0 1rem;
    }
    
    .news-card {
        min-height: 360px !important;
        max-height: 400px !important;
    }
    
    .news-card-image {
        height: 180px !important;
    }
    
    .news-card-title {
        font-size: 1rem;
    }
    
    .news-card-description {
        font-size: 0.875rem;
    }
    
    .skeleton-card {
        grid-template-columns: 44px 1fr;
    }
    
    .skeleton-image {
        display: none;
    }
    
    .news-hub-skeleton-container {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .news-hub-left-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .news-hub-left-sidebar.open {
        transform: translateX(0);
    }
    
    .news-hub-main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .news-hub-header h1 {
        font-size: 1.5rem;
    }
    
    .news-hub-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        column-gap: 0 !important;
        row-gap: 0 !important;
    }

    .news-card {
        min-height: 380px !important;
        max-height: 450px !important;
    }
    
    .news-card-image {
        width: 100% !important;
        height: 200px !important;
    }
}

/* Accessibility */
.news-card:focus-within {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.btn-vote:focus,
.btn-bookmark:focus,
.sort-filter:focus,
.nav-item:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Performance Optimizations */
.news-card-image img {
    content-visibility: auto;
    will-change: transform;
}

.news-card {
    contain: layout style paint;
}

/* Print Styles */
@media print {
    .news-hub-left-sidebar,
    .news-hub-right-sidebar,
    .news-card-actions,
    .news-hub-filters {
        display: none;
    }
    
    .news-hub-main-content {
        margin-left: 0;
    }
    
    .news-hub-grid {
        grid-template-columns: 1fr;
    }
}
