/**
 * GPCC Report Popup Styles
 * 
 * Popup overlay, modal, countdown timer, form, and success states
 * for the report broken link feature.
 * 
 * @package GeneratePress_Child
 * @since 2.1.0
 */

/* ===================================
   Overlay (backdrop)
   =================================== */
.gpcc-report-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gpcc-report-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   Popup Container
   =================================== */
.gpcc-report-popup {
    background: var(--surface-2, #1A2642);
    border: 1px solid var(--border, #334155);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.gpcc-report-overlay.is-visible .gpcc-report-popup {
    transform: translateY(0) scale(1);
}

/* ===================================
   Close Button
   =================================== */
.gpcc-report-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--surface-3, #233451);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #94A3B8);
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10;
}

.gpcc-report-close:hover {
    background: var(--primary, #3B82F6);
    color: #fff;
}

.gpcc-report-close svg {
    width: 16px;
    height: 16px;
}

/* ===================================
   Popup Header
   =================================== */
.gpcc-report-header {
    padding: 24px 24px 0;
    text-align: center;
}

.gpcc-report-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text, #E5EAF3);
    margin: 0 0 8px;
}

.gpcc-report-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted, #94A3B8);
    margin: 0;
}

/* ===================================
   Popup Body
   =================================== */
.gpcc-report-body {
    padding: 24px;
}

/* ===================================
   Countdown State
   =================================== */
.gpcc-report-countdown {
    text-align: center;
    padding: 40px 0;
}

.gpcc-report-countdown__spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.gpcc-report-countdown__circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--surface-3, #233451);
    border-top-color: var(--primary, #3B82F6);
    animation: gpcc-spin 1s linear infinite;
}

@keyframes gpcc-spin {
    to {
        transform: rotate(360deg);
    }
}

.gpcc-report-countdown__number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text, #E5EAF3);
}

.gpcc-report-countdown__text {
    font-size: 0.9375rem;
    color: var(--text-muted, #94A3B8);
}

/* ===================================
   Form State
   =================================== */
.gpcc-report-form {
    display: none;
}

.gpcc-report-form.is-visible {
    display: block;
}

.gpcc-report-form__group {
    margin-bottom: 20px;
}

.gpcc-report-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text, #E5EAF3);
    margin-bottom: 8px;
}

.gpcc-report-form__select,
.gpcc-report-form__textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface-3, #233451);
    border: 1px solid var(--border, #334155);
    border-radius: 8px;
    color: var(--text, #E5EAF3);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gpcc-report-form__select:focus,
.gpcc-report-form__textarea:focus {
    outline: none;
    border-color: var(--primary, #3B82F6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.gpcc-report-form__select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.gpcc-report-form__textarea {
    min-height: 100px;
    resize: vertical;
}

.gpcc-report-form__message-group {
    display: none;
}

.gpcc-report-form__message-group.is-visible {
    display: block;
}

/* ===================================
   Submit Button
   =================================== */
.gpcc-report-form__submit {
    width: 100%;
    padding: 14px 24px;
    background: #10B981;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gpcc-report-form__submit:hover:not(:disabled) {
    background: #0d9668;
    transform: translateY(-1px);
}

.gpcc-report-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gpcc-report-form__submit--loading {
    position: relative;
    color: transparent;
}

.gpcc-report-form__submit--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gpcc-spin 0.8s linear infinite;
}

/* ===================================
   Success State
   =================================== */
.gpcc-report-success {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.gpcc-report-success.is-visible {
    display: block;
}

.gpcc-report-success__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gpcc-report-success__icon svg {
    width: 32px;
    height: 32px;
    color: #10B981;
}

.gpcc-report-success__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #E5EAF3;
    margin: 0 0 8px;
}

.gpcc-report-success__message {
    font-size: 0.9375rem;
    color: #94A3B8;
    margin: 0 0 24px;
}

.gpcc-report-success__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gpcc-report-success__btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

/* Primary button - Blue solid background */
.gpcc-report-success__btn--primary {
    background: #3B82F6;
    color: #fff;
    border: 1px solid #3B82F6;
}

.gpcc-report-success__btn--primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

/* Secondary button - Transparent with border */
.gpcc-report-success__btn--secondary {
    background: transparent;
    color: #E5EAF3;
    border: 1px solid #4B5563;
}

.gpcc-report-success__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #3B82F6;
}

/* ===================================
   Error Message
   =================================== */
.gpcc-report-error {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #f87171;
    font-size: 0.875rem;
}

.gpcc-report-error.is-visible {
    display: block;
}

/* ===================================
   Responsive Adjustments
   =================================== */
@media (max-width: 480px) {
    .gpcc-report-popup {
        border-radius: 12px;
    }

    .gpcc-report-header,
    .gpcc-report-body {
        padding: 20px;
    }

    .gpcc-report-header {
        padding-bottom: 0;
    }

    .gpcc-report-success__actions {
        flex-direction: column;
    }

    .gpcc-report-success__btn {
        width: 100%;
        text-align: center;
    }
}

/* ===================================
   Report Link Button Style
   =================================== */
.gpcc-report-trigger {
    background: transparent;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gpcc-report-trigger:hover {
    text-decoration: none;
}