/**
 * Viral Hook Generator - Frontend Styles
 * Uses CSS Variables for customization (injected via PHP)
 */

:root {
    --vhh-primary: #6366f1;
    --vhh-secondary: #10b981;
    --vhh-text: #f1f5f9;
    --vhh-cta: #f59e0b;
    --vhh-bg: #0f172a;
    --vhh-bg-card: rgba(30, 41, 59, 0.8);
    --vhh-bg-glass: rgba(255, 255, 255, 0.05);
    --vhh-border: rgba(255, 255, 255, 0.1);
    --vhh-error: #ef4444;
    --vhh-success: #22c55e;
    --vhh-radius: 16px;
    --vhh-radius-sm: 8px;
    --vhh-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.vhh-generator-container,
.vhh-timer-container {
    max-width: 720px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--vhh-bg);
    border-radius: var(--vhh-radius);
    box-shadow: var(--vhh-shadow);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--vhh-text);
}

.vhh-header,
.vhh-timer-header {
    text-align: center;
    margin-bottom: 2rem;
}

.vhh-title,
.vhh-timer-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, var(--vhh-primary), var(--vhh-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vhh-subtitle,
.vhh-timer-subtitle {
    color: rgba(241, 245, 249, 0.7);
    font-size: 1rem;
    margin: 0;
}

.vhh-form-section {
    background: var(--vhh-bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--vhh-border);
    border-radius: var(--vhh-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.vhh-form-group {
    margin-bottom: 1.25rem;
}

.vhh-form-group:last-child {
    margin-bottom: 0;
}

.vhh-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--vhh-text);
    margin-bottom: 0.5rem;
}

.vhh-input,
.vhh-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--vhh-text);
    background: var(--vhh-bg-card);
    border: 1px solid var(--vhh-border);
    border-radius: var(--vhh-radius-sm);
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.vhh-input:focus,
.vhh-select:focus {
    border-color: var(--vhh-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.vhh-input::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

.vhh-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.vhh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--vhh-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.vhh-button-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--vhh-primary), color-mix(in srgb, var(--vhh-primary) 80%, black));
    color: white;
}

.vhh-button-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px var(--vhh-primary);
}

.vhh-button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vhh-button-unlock {
    background: linear-gradient(135deg, var(--vhh-cta), color-mix(in srgb, var(--vhh-cta) 80%, black));
    color: white;
}

.vhh-button-unlock:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px var(--vhh-cta);
}

.vhh-button-cta {
    background: var(--vhh-cta);
    color: white;
    margin-top: 1.5rem;
}

.vhh-button-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px var(--vhh-cta);
}

.vhh-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: vhh-spin 0.8s linear infinite;
}

@keyframes vhh-spin {
    to {
        transform: rotate(360deg);
    }
}

.vhh-credits-info {
    text-align: center;
    margin-top: 1rem;
}

.vhh-credits-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--vhh-bg-card);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: rgba(148, 163, 184, 1);
}

.vhh-unlock-cta {
    margin: 1.5rem 0;
}

.vhh-unlock-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--vhh-radius);
    padding: 2rem;
    text-align: center;
}

.vhh-unlock-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.vhh-unlock-card h3 {
    margin: 0 0 0.5rem;
    color: var(--vhh-cta);
}

.vhh-unlock-card p {
    color: rgba(148, 163, 184, 1);
    margin: 0 0 1.5rem;
}

.vhh-results {
    margin-top: 2rem;
}

.vhh-results-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--vhh-text);
}

.vhh-results-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vhh-hook-card {
    background: var(--vhh-bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--vhh-border);
    border-radius: var(--vhh-radius-sm);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
}

.vhh-hook-card:hover {
    border-color: var(--vhh-primary);
    transform: translateX(4px);
}

.vhh-hook-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--vhh-text);
}

.vhh-copy-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--vhh-bg-card);
    color: var(--vhh-primary);
    border: 1px solid var(--vhh-primary);
    border-radius: var(--vhh-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.vhh-copy-btn:hover {
    background: var(--vhh-primary);
    color: white;
}

.vhh-copy-btn.copied {
    background: var(--vhh-success);
    border-color: var(--vhh-success);
    color: white;
}

.vhh-footer-cta {
    text-align: center;
    margin-top: 1.5rem;
}

.vhh-skeleton {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.vhh-skeleton-card {
    background: var(--vhh-bg-card);
    border-radius: var(--vhh-radius-sm);
    padding: 1.25rem;
}

.vhh-skeleton-line {
    height: 1rem;
    background: linear-gradient(90deg, var(--vhh-bg-glass) 0%, rgba(255, 255, 255, 0.1) 50%, var(--vhh-bg-glass) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    animation: vhh-shimmer 1.5s infinite;
}

.vhh-skeleton-line:last-child {
    margin-bottom: 0;
}

.vhh-skeleton-line-long {
    width: 100%;
}

.vhh-skeleton-line-medium {
    width: 75%;
}

.vhh-skeleton-line-short {
    width: 50%;
}

@keyframes vhh-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.vhh-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--vhh-radius-sm);
    color: var(--vhh-error);
    margin-top: 1rem;
}

.vhh-error-icon {
    font-size: 1.25rem;
}

.vhh-timer-display {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.vhh-timer-circle {
    position: relative;
    width: 200px;
    height: 200px;
}

.vhh-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.vhh-timer-bg {
    fill: none;
    stroke: var(--vhh-bg-card);
    stroke-width: 8;
}

.vhh-timer-progress {
    fill: none;
    stroke: var(--vhh-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s linear;
}

.vhh-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.vhh-timer-seconds {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--vhh-text);
}

.vhh-timer-label {
    display: block;
    font-size: 0.875rem;
    color: rgba(148, 163, 184, 1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.vhh-timer-status {
    text-align: center;
    margin: 1rem 0;
    font-size: 1rem;
}

.vhh-status-active {
    color: var(--vhh-success);
}

.vhh-status-paused {
    color: var(--vhh-cta);
    animation: vhh-pulse 1s ease-in-out infinite;
}

@keyframes vhh-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.vhh-timer-success {
    margin: 2rem 0;
}

.vhh-success-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--vhh-radius);
    padding: 2rem;
    text-align: center;
}

.vhh-success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.vhh-success-card h3 {
    margin: 0 0 0.5rem;
    color: var(--vhh-success);
    font-size: 1.5rem;
}

.vhh-success-card p {
    color: rgba(148, 163, 184, 1);
    margin: 0 0 1.5rem;
}

.vhh-timer-notice {
    background: var(--vhh-bg-glass);
    border: 1px solid var(--vhh-border);
    border-radius: var(--vhh-radius-sm);
    padding: 1rem;
    text-align: center;
}

.vhh-timer-notice p {
    margin: 0;
    color: rgba(148, 163, 184, 1);
    font-size: 0.875rem;
}

.vhh-turnstile-wrapper {
    display: flex;
    justify-content: center;
}

@media (max-width: 640px) {

    .vhh-generator-container,
    .vhh-timer-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .vhh-title,
    .vhh-timer-title {
        font-size: 1.5rem;
    }

    .vhh-hook-card {
        flex-direction: column;
    }

    .vhh-copy-btn {
        width: 100%;
    }

    .vhh-timer-circle {
        width: 160px;
        height: 160px;
    }

    .vhh-timer-seconds {
        font-size: 2.5rem;
    }
}