/* Portfolio show page */
:root {
    --primary: var(--primary-color);
    --secondary: var(--secondary-color);
    --danger: var(--danger-color);
    --warning: var(--warning-color);
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

.portfolio-detail-section {
    padding: 0;
    background: var(--gray-50);
    min-height: 100vh;
}

.portfolio-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 16px;
}

.portfolio-detail-layout {
    display: block;
}

/* Main Content */
.portfolio-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Gallery Section */
.portfolio-gallery-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-100);
    margin-bottom: 16px;
    cursor: pointer;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.main-image-container:hover img {
    transform: scale(1.02);
}

.gallery-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: thin;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.thumbnail:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

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

/* Header Info */
.portfolio-header-info-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.portfolio-author-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.author-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.author-info-large {
    flex: 1;
}

.author-info-large h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 8px 0;
}

.author-rating-large {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fbbf24;
    font-size: 14px;
}

.rating-count {
    color: var(--gray-500);
    font-size: 13px;
}

.portfolio-header-info-card h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.portfolio-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.meta-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-700);
}

.meta-badge i {
    color: var(--primary);
    font-size: 14px;
}

/* Content Cards */
.content-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.content-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.description-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--gray-700);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Links Section */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.link-card:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.link-card:hover .link-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.link-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.3s;
}

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

.link-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 4px 0;
    display: block;
}

.link-card:hover .link-title {
    color: white;
}

.link-url {
    font-size: 12px;
    color: var(--gray-500);
    word-break: break-all;
    display: block;
}

.link-card:hover .link-url {
    color: rgba(255,255,255,0.9);
}

.author-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    color: white;
}

.author-stats {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.author-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: var(--gray-50);
    border-radius: 12px;
    min-width: 120px;
}

.author-stat-item strong {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.author-stat-item span {
    font-size: 12px;
    color: var(--gray-600);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: var(--gray-900);
    transition: all 0.3s;
}

.lightbox-close:hover {
    background: var(--primary);
    color: white;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--gray-900);
    transition: all 0.3s;
}

.lightbox-nav:hover {
    background: var(--primary);
    color: white;
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

/* Responsive */
@media (max-width: 1024px) {
    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .portfolio-detail-container {
        padding: 16px;
    }

    .portfolio-header-info-card h1 {
        font-size: 24px;
    }

    .portfolio-header-info-card,
    .content-card,
    .portfolio-gallery-card {
        padding: 20px;
    }

    .gallery-thumbnails {
        gap: 8px;
    }

    .thumbnail {
        width: 80px;
        height: 80px;
    }

    .links-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-meta-badges {
        flex-direction: column;
        gap: 8px;
    }

    .author-stats {
        flex-direction: column;
        width: 100%;
    }

    .author-stat-item {
        width: 100%;
    }

    .author-actions {
        width: 100%;
    }

    .author-actions .btn {
        flex: 1;
    }

    .related-portfolios-grid {
        grid-template-columns: 1fr !important;
    }
}

.author-info-large--grow {
    flex: 1;
}

.portfolio-cta-card {
    background: var(--primary-light);
    border: 2px solid var(--primary-muted);
}

.portfolio-cta-text {
    color: var(--primary-dark);
    font-size: 1rem;
    margin-bottom: 16px;
}

.related-portfolios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.related-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.related-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.related-item-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-item-placeholder {
    width: 100%;
    height: 180px;
}

.related-item-placeholder i {
    font-size: 48px;
    color: var(--text-muted);
}

.related-item-body {
    padding: 16px;
}

.related-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px 0;
}

.related-item-author {
    font-size: 14px;
    color: var(--text-light);
}

/* Portfolio details dashboard */
.portfolio-details-page { max-width: var(--container-max); margin: 0 auto; }
