/* YouTube Video Description Generator - Custom Styles */

/* ===== Mobile Button Optimizations ===== */
@media (max-width: 640px) {
    #generate-btn {
        padding: 1.25rem 0.75rem;
    }

    #btn-text {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        font-size: 1.1rem;
    }

    /* Gentle glow animation for the button */
    @keyframes gentle-glow {
        0% {
            box-shadow: 0 6px 20px rgba(255, 214, 1, 0.4),
                0 0 0 2px rgba(255, 214, 1, 0.1),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
        }
        50% {
            box-shadow: 0 8px 30px rgba(255, 214, 1, 0.65),
                0 0 0 3px rgba(255, 214, 1, 0.2),
                inset 0 2px 0 rgba(255, 255, 255, 0.5);
        }
        100% {
            box-shadow: 0 6px 20px rgba(255, 214, 1, 0.4),
                0 0 0 2px rgba(255, 214, 1, 0.1),
                inset 0 2px 0 rgba(255, 255, 255, 0.3);
        }
    }

    #generate-btn {
        animation: gentle-glow 3s infinite ease-in-out;
    }
}

/* ===== Toast Container Styles ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease-in-out;
    background-color: #1B3C6B;
    color: white;
}

/* Mobile: centered toast */
@media (max-width: 1023px) {
    .toast-container {
        left: 50% !important;
        right: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 80% !important;
        max-width: 80% !important;
        transform: translateX(-50%) !important;
    }

    .toast-container.-translate-y-full,
    .toast-container[class*="-translate-y-full"] {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) translateY(-100%) !important;
    }

    .toast-container:not(.hidden):not(.-translate-y-full),
    .toast-container:not(.hidden):not([class*="-translate-y-full"]) {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    div#toast.toast-container {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    div#toast.toast-container.-translate-y-full {
        transform: translateX(-50%) translateY(-100%) !important;
    }
}

/* Desktop: right side toast */
@media (min-width: 1024px) {
    .toast-container {
        left: auto;
        right: 1rem;
        transform: translateX(0);
    }

    .toast-container.translate-x-full {
        transform: translateX(100%);
    }

    .toast-container.translate-x-0 {
        transform: translateX(0);
    }
}

.toast-container.hidden {
    display: none !important;
}

/* ===== Description Card Styles ===== */
.description-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.description-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #1B3C6B;
}

.description-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.description-card-title {
    font-weight: 600;
    color: #1B3C6B;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.description-card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: #1B3C6B;
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
}

.description-card-content {
    color: #374151;
    line-height: 1.75;
    white-space: pre-wrap;
    font-size: 0.9375rem;
}

/* Advanced description formatting */
.description-card-content.advanced {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', monospace;
    font-size: 0.875rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
}

/* ===== Copy Button Styles ===== */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #1B3C6B;
    color: #1B3C6B;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #1B3C6B;
    color: white;
}

.copy-btn.copied {
    background: #059669;
    border-color: #059669;
    color: white;
}

.copy-btn svg {
    width: 1rem;
    height: 1rem;
}

/* ===== Loading Spinner ===== */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #1B3C6B;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Email Input Container ===== */
.email-input-container {
    width: 80%;
}

@media (min-width: 640px) {
    .email-input-container {
        width: 50%;
    }
}

@media (min-width: 1024px) {
    .email-input-container {
        width: 480px;
        max-width: none;
    }
}

/* ===== FAQ Accordion Styles ===== */
details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary {
    background-color: #f9fafb;
}

/* ===== Textarea Auto-resize ===== */
textarea {
    min-height: 100px;
}

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 60%;
}

/* ===== Error State ===== */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== Success Badge ===== */
.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #d1fae5;
    color: #059669;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== Progress Indicator ===== */
.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1B3C6B, #FFD601);
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 50%;
        margin-left: 25%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .description-card {
        padding: 1rem;
    }

    .description-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Focus States for Accessibility ===== */
input:focus,
textarea:focus,
button:focus {
    outline: 2px solid #1B3C6B;
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

button:focus-visible {
    outline: 2px solid #1B3C6B;
    outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .toast-container,
    #cookie-consent,
    header,
    footer,
    #advanced-section,
    button {
        display: none !important;
    }

    .description-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

