/**
 * Worksheet Share Modal Styles
 * Version 1.0
 */

/* Modal Container */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.share-modal.open {
    opacity: 1;
    visibility: visible;
}

/* Backdrop */
.share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Content Panel */
.share-modal__content {
    position: relative;
    background: var(--c-surface, #ffffff);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.share-modal.open .share-modal__content {
    transform: scale(1) translateY(0);
}

/* Close Button */
.share-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--c-bg, #f5f5f5);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-muted, #666);
    transition: all 0.2s ease;
}

.share-modal__close:hover {
    background: var(--c-danger, #dc3545);
    color: white;
}

/* Title */
.share-modal__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--c-text, #333);
}

/* Preview Area */
.share-modal__preview {
    background: var(--c-bg, #f5f5f5);
    border-radius: 12px;
    padding: 16px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 2px dashed var(--c-border, #ddd);
}

.share-modal__image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Loading State */
.share-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--c-text-muted, #666);
}

.share-modal__loading .material-icons-round {
    font-size: 32px;
    color: var(--c-primary, #007bff);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* Error State */
.share-modal__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--c-danger, #dc3545);
    text-align: center;
}

.share-modal__error .material-icons-round {
    font-size: 40px;
}

/* Action Buttons */
.share-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.share-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pinterest Button */
.share-btn--pinterest {
    background: #E60023;
    color: white;
}

.share-btn--pinterest:not(:disabled):hover {
    background: #ad081b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 35, 0.3);
}

/* Download Button */
.share-btn--download {
    background: var(--c-bg, #f5f5f5);
    color: var(--c-text, #333);
    border: 2px solid var(--c-border, #ddd);
}

.share-btn--download:not(:disabled):hover {
    background: var(--c-primary, #007bff);
    color: white;
    border-color: var(--c-primary, #007bff);
    transform: translateY(-2px);
}

/* Tip Text */
.share-modal__tip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--c-text-muted, #888);
    background: var(--c-bg, #f5f5f5);
    padding: 10px 12px;
    border-radius: 8px;
}

/* Dark Theme Support */
[data-theme="dark"] .share-modal__content {
    background: var(--c-surface, #1e1e1e);
}

[data-theme="dark"] .share-modal__preview {
    background: var(--c-bg, #121212);
    border-color: var(--c-border, #333);
}

[data-theme="dark"] .share-btn--download {
    background: var(--c-bg, #121212);
    border-color: var(--c-border, #333);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .share-modal__content {
        padding: 20px;
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .share-modal__title {
        font-size: 18px;
        padding-right: 30px;
    }

    .share-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Print - Hide modal */
@media print {
    .share-modal {
        display: none !important;
    }
}
