:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: pageFadeIn 0.8s ease-out forwards;
}

@keyframes pageFadeIn {
    to {
        opacity: 1;
    }
}

header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-container {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    color: #1e293b;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.shortener-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    margin-bottom: 3rem;
}

.input-container {
    display: flex;
    gap: 1rem;
}

input {
    flex: 1;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

button {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: translateY(0);
}

.recent-links {
    width: 100%;
    max-width: 800px;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-item {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.link-item:hover {
    border-color: var(--primary);
}

.link-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.short-url {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.original-url {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    background: var(--primary);
    color: white !important;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.action-btn.secondary {
    background: transparent;
    color: var(--text-main) !important;
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

#resultArea {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: none;
}

.ads-container {
    margin-top: 4rem;
    width: 100%;
    max-width: 800px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    width: 100%;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    text-align: left;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.how-it-works {
    margin-top: 6rem;
    text-align: center;
    width: 100%;
}

.steps-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
}

.step {
    flex: 1;
    position: relative;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h4 {
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.footer-brand h5,
.footer-brand p {
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-links div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.footer-links a {
    text-decoration: none;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

#qrcode-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

#qrCanvas {
    max-width: 100%;
}

.limit-warning {
    margin-top: 1.5rem;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: var(--danger);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.clicks-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: inline-block;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

.delay-3 {
    transition-delay: 0.6s;
}

.pricing,
.faq {
    margin-top: 8rem;
    text-align: center;
    width: 100%;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.pricing-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.pricing-card.featured {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    position: relative;
    z-index: 1;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.4);
}

.pricing-card.featured .price span,
.pricing-card.featured h3 {
    color: rgba(255, 255, 255, 0.8);
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.price {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 1.5rem 0;
}

.price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pricing-features {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.pricing-features li::before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
}

.pricing-card.featured .pricing-features li::before {
    color: white;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
}

.faq-question svg {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    margin-top: 1rem;
}

.cta-section {
    background: #1e293b;
    color: white;
    padding: 6rem 2rem;
    border-radius: 32px;
    margin: 8rem 0;
    text-align: center;
    width: 100%;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {

    .features-grid,
    .steps-container,
    .pricing-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .pricing-card.featured {
        transform: none;
    }
}

@media (max-width: 640px) {
    .input-container {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

/* Legal Page Enhancements */
.legal-header {
    text-align: center;
    margin: 4rem 0 6rem;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-bottom: 6rem;
}

.legal-section {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.legal-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid currentColor;
    font-size: 1.5rem;
}

.legal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.legal-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Enhanced Footer */
.enhanced-footer {
    background: #111827;
    color: #f3f4f6;
    padding: 6rem 2rem 2rem;
    margin-top: 8rem;
    width: 100%;
}

.footer-top {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h4,
.footer-col h5 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.footer-col p {
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col ul a,
.footer-col a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-col ul a:hover,
.footer-col a:hover {
    color: white;
}

.footer-newsletter {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.footer-newsletter input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    flex-grow: 1;
}

.enhanced-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 4rem auto 0;
    color: #6b7280;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

@media (max-width: 968px) {

    .legal-grid,
    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}