/**
 * Additional admin styles
 */

/* Animations */
@keyframes ld-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.ld-spin {
    animation: ld-spin 1s linear infinite;
}

@keyframes ld-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ld-fade-in {
    animation: ld-fade-in 0.3s ease;
}

/* Notification toast */
.ld-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--ld-gray-900);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--ld-radius-md);
    border: 1px solid var(--ld-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: ld-fade-in 0.3s ease;
}

.ld-toast.success {
    background-color: var(--ld-success);
}

.ld-toast.error {
    background-color: var(--ld-error);
}

/* Modal */
.ld-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ld-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.ld-modal {
    background-color: white;
    border-radius: var(--ld-radius-md);
    border: 1px solid var(--ld-border);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ld-modal-overlay.open .ld-modal {
    transform: scale(1);
}

.ld-modal-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ld-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.ld-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ld-gray-400);
    padding: 0.25rem;
}

.ld-modal-close:hover {
    color: var(--ld-gray-600);
}

.ld-modal-body {
    padding: 1.5rem;
}

.ld-modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Empty states */
.ld-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.ld-empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--ld-gray-300);
}

.ld-empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ld-gray-900);
    margin-bottom: 0.5rem;
}

.ld-empty-state-text {
    color: var(--ld-gray-500);
    margin-bottom: 1.5rem;
}

/* Skeleton loading */
.ld-skeleton {
    background: linear-gradient(90deg, var(--ld-gray-200) 25%, var(--ld-gray-100) 50%, var(--ld-gray-200) 75%);
    background-size: 200% 100%;
    animation: ld-skeleton 1.5s ease-in-out infinite;
    border-radius: var(--ld-radius-sm);
}

@keyframes ld-skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.ld-skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.ld-skeleton-text:last-child {
    width: 70%;
}

.ld-skeleton-card {
    height: 200px;
}

/* Dropdown */
.ld-dropdown {
    position: relative;
}

.ld-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: var(--ld-radius-sm);
    border: 1px solid var(--ld-border);
    min-width: 200px;
    padding: 0.25rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.ld-dropdown.open .ld-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ld-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: var(--ld-gray-700);
    text-decoration: none;
    border-radius: var(--ld-radius-sm);
    font-size: 0.875rem;
}

.ld-dropdown-item:hover {
    background-color: var(--ld-gray-100);
}

.ld-dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--ld-gray-400);
}

.ld-dropdown-divider {
    height: 1px;
    background-color: var(--ld-gray-200);
    margin: 0.5rem 0;
}

/* Badge */
.ld-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--ld-radius-full);
}

.ld-badge-primary {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--ld-primary);
}

.ld-badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--ld-success);
}

.ld-badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--ld-warning);
}

.ld-badge-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--ld-error);
}

/* Progress bar */
.ld-progress {
    height: 8px;
    background-color: var(--ld-gray-200);
    border-radius: var(--ld-radius-full);
    overflow: hidden;
}

.ld-progress-bar {
    height: 100%;
    background-color: var(--ld-primary);
    border-radius: var(--ld-radius-full);
    transition: width 0.3s ease;
}

/* Tabs — Vercel underline style */
.ld-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ld-border);
    width: 100%;
}

.ld-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ld-gray-500);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.15s ease;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    margin-bottom: -1px;
}

.ld-tab:hover {
    color: var(--ld-gray-900);
}

.ld-tab.active {
    color: var(--ld-gray-900);
    background: transparent;
    border-bottom-color: var(--ld-gray-900);
    font-weight: 600;
}

/* Alert */
.ld-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--ld-radius-md);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.ld-alert-info {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--ld-info);
}

.ld-alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--ld-success);
}

.ld-alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--ld-warning);
}

.ld-alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--ld-error);
}

.ld-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ld-alert-content {
    flex: 1;
}

.ld-alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ld-alert-text {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Logo Generator */
.ld-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ld-logo-option {
    background: white;
    border: 1px solid var(--ld-border);
    border-radius: var(--ld-radius-md);
    padding: 1rem;
    text-align: center;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.ld-logo-option:hover {
    border-color: var(--ld-gray-300);
}

.ld-logo-option.selected {
    border-color: var(--ld-gray-900);
    background: white;
}

.ld-logo-option img {
    width: 100%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border-radius: var(--ld-radius-md);
    background: white;
}

.ld-logo-option .ld-btn {
    width: 100%;
}

.ld-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* =========================================
 * Google Auth Styles
 * ========================================= */

.ld-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid var(--ld-border);
    color: var(--ld-gray-700);
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: var(--ld-radius-sm);
    transition: all 0.15s ease;
}

.ld-btn-google:hover {
    background: var(--ld-gray-50);
    border-color: var(--ld-gray-300);
}

.ld-btn-google svg {
    flex-shrink: 0;
}

.ld-auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--ld-gray-400);
    font-size: 0.875rem;
}

.ld-auth-divider::before,
.ld-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ld-gray-200);
}

.ld-auth-divider span {
    padding: 0 1rem;
}

.ld-auth-success {
    background: #d1fae5;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: var(--ld-radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.ld-auth-referral {
    background: #fef3c7;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: var(--ld-radius-sm);
    border: 1px solid #fde68a;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-align: center;
}

.ld-password-input {
    position: relative;
}

.ld-password-input input {
    padding-right: 3rem;
}

.ld-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ld-gray-400);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ld-toggle-password:hover {
    color: var(--ld-gray-600);
}

.ld-password-strength {
    height: 4px;
    background: var(--ld-gray-200);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.ld-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.ld-forgot-link {
    float: right;
    font-size: 0.8125rem;
    color: var(--ld-primary);
    text-decoration: none;
    font-weight: 400;
}

.ld-forgot-link:hover {
    text-decoration: underline;
}

/* =========================================
 * SVG Size Controls
 * ========================================= */

/* Prevent SVGs from being huge when inline */
input[type="text"] svg,
textarea svg,
.section-panel svg:not([class*="w-"]) {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    max-width: 24px;
    max-height: 24px;
}

/* Force small SVGs for icon inputs */
input.text-center.text-xl svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

/* Fix for raw SVG/JSON showing in inputs */
input[value^="<svg"],
input[value^="{"] {
    font-size: 0.7rem;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Tailwind animation utilities that might be missing */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Line clamp for SEO preview */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================================================
   BILLING TOGGLE STYLES (shared)
   ===================================================== */

.ld-billing-toggle {
    background: var(--ld-gray-100);
    padding: 3px;
    border-radius: var(--ld-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--ld-border);
}

.ld-toggle-btn {
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--ld-gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ld-toggle-btn:hover {
    color: var(--ld-gray-700);
}

.ld-toggle-btn.active {
    background: white;
    color: var(--ld-gray-900);
    font-weight: 600;
}

.ld-save-badge {
    background: var(--ld-accent);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: var(--ld-radius-full);
    text-transform: uppercase;
}

.ld-toggle-btn.active .ld-save-badge {
    animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Plan card styles (billing page) */
.ld-plan-card {
    transition: all 0.2s ease;
}

.ld-plan-card:hover {
    border-color: var(--ld-gray-300) !important;
}

.ld-plan-card.ld-current-plan {
    background: white;
    border-color: var(--ld-gray-900) !important;
}

/* =========================================
   DESIGN SHOWCASE - VITRINA PREMIUM
   ========================================= */

.ld-design-showcase {
    background: var(--ld-gray-50);
    border-radius: var(--ld-radius-md);
    border: 1px solid var(--ld-border);
    padding: 2rem;
    margin: 1rem 0;
}

/* Header emocional */
.ld-showcase-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ld-showcase-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ld-gray-900);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
}

.ld-showcase-subtitle {
    font-size: 1.1rem;
    color: var(--ld-gray-500);
    margin: 0;
}

/* Style Selector Pills */
.ld-style-selector {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ld-style-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--ld-border);
    background: white;
    border-radius: var(--ld-radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ld-gray-600);
    position: relative;
    overflow: hidden;
}

.ld-style-pill:hover {
    border-color: var(--ld-gray-300);
    color: var(--ld-gray-900);
}

.ld-style-pill.active {
    border-color: var(--ld-gray-900);
    background: var(--ld-gray-900);
    color: white;
}

.ld-pill-icon {
    font-size: 1.1rem;
}

.ld-pill-label {
    font-weight: 600;
}

.ld-pill-check {
    display: none;
    width: 18px;
    height: 18px;
    background: white;
    color: var(--ld-primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    animation: checkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ld-style-pill.active .ld-pill-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes checkPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Device Toggle */
.ld-device-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ld-device-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--ld-gray-400);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
}

.ld-device-btn:hover {
    color: var(--ld-gray-600);
    background: rgba(0, 0, 0, 0.03);
}

.ld-device-btn.active {
    color: var(--ld-gray-900);
    background: var(--ld-gray-100);
}

.ld-device-btn svg {
    stroke-width: 1.5;
}

/* Browser Mockup */
.ld-browser-mockup {
    background: white;
    border-radius: var(--ld-radius-md);
    border: 1px solid var(--ld-border);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 1100px;
    margin: 0 auto;
}

/* Browser Bar */
.ld-browser-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #FAFAFA;
    border-bottom: 1px solid var(--ld-border);
}

.ld-browser-dots {
    display: flex;
    gap: 6px;
}

.ld-browser-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.ld-browser-dots span:nth-child(1) { background: #ff5f57; }
.ld-browser-dots span:nth-child(2) { background: #ffbd2e; }
.ld-browser-dots span:nth-child(3) { background: #28c840; }

.ld-browser-url {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    color: var(--ld-gray-500);
}

.ld-browser-url svg {
    color: #28c840;
    stroke-width: 2;
}

.ld-browser-fullscreen {
    background: transparent;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--ld-gray-400);
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.ld-browser-fullscreen:hover {
    color: var(--ld-gray-700);
    background: rgba(0, 0, 0, 0.05);
}

/* Preview Viewport */
.ld-preview-viewport {
    position: relative;
    height: 600px;
    background: #fafafa;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ld-preview-viewport.mobile-view {
    max-width: 375px;
    height: 700px;
    margin: 2rem auto;
    border-radius: 2rem;
    border: 8px solid #1f2937;
}

.ld-preview-viewport.mobile-view::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    background: #374151;
    border-radius: 10px;
    z-index: 10;
}

/* Loading overlay */
.ld-preview-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.ld-preview-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.ld-preview-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ld-gray-200);
    border-top-color: var(--ld-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ld-preview-loading-overlay span {
    font-size: 0.9rem;
    color: var(--ld-gray-500);
}

/* CTA Section */
.ld-showcase-cta {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.ld-btn-use-design {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--ld-primary);
    color: white;
    border: none;
    border-radius: var(--ld-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.ld-btn-use-design:hover {
    background: var(--ld-primary-dark);
}

.ld-btn-use-design:active {
    background: var(--ld-primary-dark);
}

.ld-cta-hint {
    margin: 0.75rem 0 0 0;
    font-size: 0.85rem;
    color: var(--ld-gray-400);
}

/* Responsive */
@media (max-width: 768px) {
    .ld-design-showcase {
        padding: 1.5rem 1rem;
        border-radius: 1rem;
    }
    
    .ld-showcase-title {
        font-size: 1.35rem;
    }
    
    .ld-style-selector {
        gap: 0.5rem;
    }
    
    .ld-style-pill {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .ld-preview-viewport {
        height: 450px;
    }
    
    .ld-browser-mockup {
        border-radius: var(--ld-radius-sm);
    }
}
