/**
 * Artwork Page V2 - Styles
 * 
 * Individual artwork/design page with details, description, and recent designs.
 * Uses gallery-v2 CSS variables for consistency.
 * 
 * @package FlagCreator
 * @since 2.0.0
 */

/* ============================================
   CSS Variables (same as gallery-v2)
   ============================================ */
.fc-artwork-page {
    --fc-bg: #B2B2B2;
    --fc-card-bg: #2d3139;
    --fc-card-border: rgba(255, 255, 255, 0.06);
    --fc-text: #f6f7f9;
    --fc-text-muted: rgba(246, 247, 249, 0.5);
    --fc-text-secondary: rgba(246, 247, 249, 0.7);
    --fc-red: #C60C30;
    --fc-red-dark: #990924;
    --fc-green: #008C45;
    --fc-gap: 16px;
}

/* ============================================
   Container
   ============================================ */
.fc-artwork-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: var(--fc-text);
    background: var(--fc-bg);
}

/* ============================================
   Main Layout (Image + Details)
   ============================================ */
.fc-artwork-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 48px;
    margin-bottom: 64px;
    align-items: start;
}

@media (max-width: 900px) {
    .fc-artwork-main {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ============================================
   Artwork Image
   ============================================ */
.fc-artwork-image {
    position: relative;
    width: fit-content;
    max-width: 100%;
}

.fc-artwork-image img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
    cursor: zoom-in;
}

/* ============================================
   Artwork Details
   ============================================ */
.fc-artwork-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fc-artwork-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--fc-text);
    line-height: 1.2;
    margin: 0;
}

.fc-artwork-author {
    font-size: 16px;
    color: var(--fc-text-secondary);
    margin: 0;
}

.fc-artwork-author a {
    color: var(--fc-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fc-artwork-author a:hover {
    color: var(--fc-red);
}

/* ============================================
   Action Buttons Row (uses gallery-v2 button styles)
   ============================================ */
.fc-artwork-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Like Button - same as gallery-v2 */
.fc-artwork-page .fc-artwork-like-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 6px;
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
    outline: none;
    box-sizing: border-box;
}

.fc-artwork-page .fc-artwork-like-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.fc-artwork-page .fc-artwork-like-btn.is-active {
    background: var(--fc-red);
}

.fc-artwork-page .fc-artwork-like-btn.is-own {
    cursor: default;
}

/* ============================================
   Description Section
   ============================================ */
.fc-artwork-description {
    padding: 20px;
    background: var(--fc-card-bg);
    border-radius: 12px;
    border: 1px solid var(--fc-card-border);
}

.fc-artwork-description__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fc-artwork-description__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fc-text-muted);
}

.fc-artwork-description__edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--fc-card-border);
    border-radius: 6px;
    color: var(--fc-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1;
    outline: none;
}

.fc-artwork-description__edit-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--fc-text);
    border-color: rgba(255, 255, 255, 0.15);
}

.fc-artwork-description__edit-btn svg {
    width: 14px;
    height: 14px;
}

.fc-artwork-description__text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--fc-text-secondary);
    margin: 0;
}

.fc-artwork-description__text--empty {
    font-style: italic;
    color: var(--fc-text-muted);
}

/* Editable textarea (hidden by default, shown on edit) */
.fc-artwork-description__textarea {
    display: none;
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--fc-card-border);
    border-radius: 8px;
    color: var(--fc-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.fc-artwork-description__textarea:focus {
    border-color: var(--fc-red);
}

.fc-artwork-description.is-editing .fc-artwork-description__text {
    display: none;
}

.fc-artwork-description.is-editing .fc-artwork-description__textarea {
    display: block;
}

.fc-artwork-description__actions {
    display: none;
    gap: 8px;
    margin-top: 12px;
}

.fc-artwork-description.is-editing .fc-artwork-description__actions {
    display: flex;
}

.fc-artwork-description__save-btn,
.fc-artwork-description__cancel-btn {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    line-height: 1;
    outline: none;
    box-sizing: border-box;
}

.fc-artwork-description__save-btn {
    background: var(--fc-red);
    color: white;
}

.fc-artwork-description__save-btn:hover {
    background: var(--fc-red-dark);
}

.fc-artwork-description__cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--fc-text);
}

.fc-artwork-description__cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   Copy to Canvas Section
   ============================================ */
.fc-artwork-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fc-artwork-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    width: 100%;
    background: var(--fc-red);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-family: inherit;
    line-height: 1;
    outline: none;
    box-sizing: border-box;
    text-decoration: none;
}

.fc-artwork-copy-btn:hover {
    background: var(--fc-red-dark);
    color: white;
}

.fc-artwork-copy-btn.disable {
    opacity: 0.6;
    cursor: wait;
}

.fc-artwork-copy-btn--disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.7;
}

.fc-artwork-copy-btn--disabled:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fc-artwork-copy-btn svg {
    width: 18px;
    height: 18px;
}

.fc-artwork-copy-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
}

.fc-artwork-copy-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.fc-artwork-pro-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--fc-text-muted);
    margin: 0;
}

.fc-artwork-pro-note a {
    color: var(--fc-red);
    text-decoration: none;
    font-weight: 600;
}

.fc-artwork-pro-note a:hover {
    text-decoration: underline;
}

/* ============================================
   Recent Designs Section
   ============================================ */
.fc-artwork-recent {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--fc-card-border);
}

.fc-artwork-recent__header {
    font-size: 20px;
    font-weight: 600;
    color: var(--fc-text);
    margin: 0 0 24px 0;
}

.fc-artwork-recent__header a {
    color: var(--fc-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fc-artwork-recent__header a:hover {
    color: var(--fc-red);
}

/* ============================================
   Masonry Grid (uses gallery-v2 card styles)
   ============================================ */
.fc-artwork-page .fc-gallery-v2__grid {
    position: relative;
    width: 100%;
}

.fc-artwork-page .fc-gallery-card {
    position: absolute;
    visibility: hidden;
}

.fc-artwork-page .fc-gallery-card.is-visible {
    visibility: visible;
}

/* ============================================
   View All Link
   ============================================ */
.fc-artwork-recent__more {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.fc-artwork-recent__more-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--fc-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.fc-artwork-recent__more-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--fc-text);
}

.fc-artwork-recent__more-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Empty / Error States
   ============================================ */
.fc-artwork-page__error {
    text-align: center;
    padding: 48px;
    color: var(--fc-text-muted);
    font-size: 16px;
}

.fc-artwork-recent__empty {
    text-align: center;
    padding: 32px;
    color: var(--fc-text-muted);
    font-size: 14px;
}

/* ============================================
   Lightbox
   ============================================ */
.fc-artwork-image {
    cursor: zoom-in;
}

.fc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    cursor: zoom-out;
}

.fc-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.fc-lightbox__image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.25s ease;
    cursor: zoom-out;
}

.fc-lightbox.is-open .fc-lightbox__image {
    transform: scale(1);
}

.fc-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.fc-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fc-lightbox__close svg {
    width: 24px;
    height: 24px;
}
