/* URL Shortener Pro - Frontend Styles */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --usp-primary: #2563eb;
    --usp-primary-dark: #1e40af;
    --usp-primary-light: #3b82f6;
    --usp-accent: #8b5cf6;
    --usp-accent-light: #a78bfa;
    --usp-success: #10b981;
    --usp-bg: #ffffff;
    --usp-bg-secondary: #f8fafc;
    --usp-bg-tertiary: #f1f5f9;
    --usp-text: #0f172a;
    --usp-text-secondary: #475569;
    --usp-text-muted: #94a3b8;
    --usp-border: #e2e8f0;
    --usp-border-light: #f1f5f9;
    --usp-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --usp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --usp-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --usp-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --usp-radius: 16px;
    --usp-radius-sm: 12px;
    --usp-radius-xs: 8px;
}

* {
    box-sizing: border-box;
}

.usp-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--usp-text);
    line-height: 1.6;
}

.usp-hero {
    text-align: center;
    margin-bottom: 48px;
    animation: uspFadeIn 0.8s ease-out;
}

.usp-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
}

.usp-title-gradient {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.usp-subtitle {
    font-size: 1.25rem;
    color: var(--usp-text-secondary);
    margin: 0;
    font-weight: 500;
}

.usp-shortener-box {
    background: var(--usp-bg);
    border-radius: var(--usp-radius);
    padding: 40px;
    box-shadow: var(--usp-shadow-xl);
    border: 1px solid var(--usp-border-light);
    animation: uspSlideUp 0.8s ease-out 0.2s both;
}

.usp-form {
    margin-bottom: 0;
}

.usp-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.usp-input-wrapper {
    position: relative;
    flex: 1;
}

.usp-input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--usp-text-muted);
    pointer-events: none;
}

.usp-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid var(--usp-border);
    border-radius: var(--usp-radius-sm);
    font-size: 16px;
    font-family: inherit;
    color: var(--usp-text);
    transition: all 0.3s ease;
    background: var(--usp-bg);
}

.usp-input:focus {
    outline: none;
    border-color: var(--usp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.usp-input::placeholder {
    color: var(--usp-text-muted);
}

.usp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: var(--usp-radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.usp-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.usp-btn-primary {
    background: linear-gradient(135deg, var(--usp-primary) 0%, var(--usp-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.usp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.usp-btn-primary:active {
    transform: translateY(0);
}

.usp-btn-icon {
    transition: transform 0.3s ease;
}

.usp-btn-primary:hover .usp-btn-icon {
    transform: translateX(4px);
}

.usp-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--usp-bg-secondary);
    border-radius: var(--usp-radius-xs);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--usp-text-secondary);
    font-weight: 500;
    margin-bottom: 0;
}

.usp-advanced-toggle svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.usp-advanced-toggle:hover {
    background: var(--usp-bg-tertiary);
    color: var(--usp-primary);
}

.usp-advanced-toggle .usp-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.usp-advanced-toggle.active .usp-chevron {
    transform: rotate(180deg);
}

.usp-advanced-options {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    margin-top: 0;
}

.usp-advanced-options.show {
    max-height: 600px;
    opacity: 1;
    margin-top: 24px;
}

.usp-field {
    margin-bottom: 20px;
}

.usp-field:last-child {
    margin-bottom: 0;
}

.usp-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--usp-text);
    font-size: 14px;
}

.usp-custom-alias-wrapper {
    display: flex;
    align-items: center;
    border: 2px solid var(--usp-border);
    border-radius: var(--usp-radius-sm);
    background: var(--usp-bg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.usp-custom-alias-wrapper:focus-within {
    border-color: var(--usp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.usp-domain {
    padding: 16px 20px;
    background: var(--usp-bg-secondary);
    color: var(--usp-text-muted);
    font-size: 15px;
    white-space: nowrap;
    border-right: 1px solid var(--usp-border);
}

.usp-input-alias {
    border: none;
    padding-left: 16px;
}

.usp-input-alias:focus {
    box-shadow: none;
}

.usp-textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--usp-border);
    border-radius: var(--usp-radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--usp-text);
    resize: vertical;
    transition: all 0.3s ease;
}

.usp-textarea:focus {
    outline: none;
    border-color: var(--usp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.usp-result {
    animation: uspFadeIn 0.5s ease-out;
}

.usp-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.usp-result-header h3 {
    margin: 0;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--usp-text);
}

.usp-success-icon {
    width: 32px;
    height: 32px;
    padding: 6px;
    background: linear-gradient(135deg, var(--usp-success) 0%, #059669 100%);
    border-radius: 50%;
    color: white;
    stroke-width: 3;
}

.usp-result-content {
    background: var(--usp-bg-secondary);
    padding: 32px;
    border-radius: var(--usp-radius-sm);
}

.usp-short-url-display {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.usp-short-url-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--usp-border);
    border-radius: var(--usp-radius-xs);
    font-size: 16px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: var(--usp-primary);
    background: var(--usp-bg);
    font-weight: 600;
}

.usp-btn-copy {
    background: var(--usp-text);
    color: #ffffff;
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.usp-btn-copy:hover {
    background: var(--usp-text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--usp-shadow-md);
}

.usp-btn-copy.copied {
    background: var(--usp-success);
}

.usp-qr-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: var(--usp-bg);
    border-radius: var(--usp-radius-xs);
    margin-bottom: 24px;
}

.usp-qr-wrapper {
    flex-shrink: 0;
}

.usp-qr-image {
    width: 140px;
    height: 140px;
    border-radius: var(--usp-radius-xs);
    border: 3px solid var(--usp-border);
}

.usp-btn-secondary {
    background: var(--usp-bg-secondary);
    color: var(--usp-text);
    border: 2px solid var(--usp-border);
    flex: 1;
}

.usp-btn-secondary:hover {
    background: var(--usp-bg-tertiary);
    border-color: var(--usp-primary);
    color: var(--usp-primary);
    transform: translateY(-2px);
}

.usp-btn-new {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
}

.usp-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.usp-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 60px;
    animation: uspFadeIn 0.8s ease-out 0.4s both;
}

.usp-feature {
    padding: 32px 24px;
    background: var(--usp-bg);
    border-radius: var(--usp-radius-sm);
    border: 1px solid var(--usp-border);
    text-align: center;
    transition: all 0.3s ease;
}

.usp-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--usp-shadow-lg);
    border-color: var(--usp-primary-light);
}

.usp-feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    padding: 14px;
    background: linear-gradient(135deg, var(--usp-primary-light) 0%, var(--usp-accent-light) 100%);
    border-radius: 14px;
    color: white;
    stroke-width: 2;
}

.usp-feature-icon svg {
    width: 100%;
    height: 100%;
}

.usp-feature h3 {
    margin: 0 0 12px 0;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--usp-text);
}

.usp-feature p {
    margin: 0;
    color: var(--usp-text-secondary);
    font-size: 15px;
}

.usp-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--usp-border);
    animation: uspFadeIn 0.8s ease-out 0.6s both;
}

.usp-footer p {
    margin: 0;
    color: var(--usp-text-muted);
    font-weight: 500;
    font-size: 15px;
}

/* Animations */
@keyframes uspFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes uspSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state */
.usp-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.usp-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: uspSpin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .usp-container {
        padding: 40px 20px;
    }

    .usp-shortener-box {
        padding: 28px 20px;
    }

    .usp-input-group {
        flex-direction: column;
    }

    .usp-btn-primary {
        width: 100%;
    }

    .usp-short-url-display {
        flex-direction: column;
    }

    .usp-btn-copy {
        width: 100%;
    }

    .usp-qr-section {
        flex-direction: column;
        text-align: center;
    }

    .usp-features {
        grid-template-columns: 1fr;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --usp-bg: #0f172a;
        --usp-bg-secondary: #1e293b;
        --usp-bg-tertiary: #334155;
        --usp-text: #f1f5f9;
        --usp-text-secondary: #cbd5e1;
        --usp-text-muted: #64748b;
        --usp-border: #334155;
        --usp-border-light: #1e293b;
    }
}