* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-card: #1E293B;
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --success: #10B981;
    --border: #334155;
}

/* Light theme */
body.light-theme {
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-card: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --accent: #3B82F6;
    --accent-hover: #2563EB;
    --success: #10B981;
    --border: #E2E8F0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

#themeToggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

#themeToggle:hover {
    background: var(--border);
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0 60px 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
}

/* Shortener Box */
.shortener-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
}

#shortenForm {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#urlInput {
    flex: 1;
    padding: 15px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#urlInput:focus {
    outline: none;
    border-color: var(--accent);
}

#urlInput:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#shortenForm button {
    background: var(--accent);
    color: #FFFFFF;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#shortenForm button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

#shortenForm button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-box {
    background: var(--bg-primary);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.result-box.hidden {
    display: none;
}

#shortUrl {
    color: var(--success);
    font-size: 1.1rem;
    font-weight: 500;
    word-break: break-all;
}

#copyBtn {
    background: var(--success);
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#copyBtn:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

#copyBtn.copied {
    background: #059669;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    #shortenForm {
        flex-direction: column;
    }

    .shortener-box {
        padding: 25px;
    }

    .result-box {
        flex-direction: column;
        align-items: stretch;
    }

    #copyBtn {
        width: 100%;
    }
}

/* Error message */
.error-box {
    background: #FEE2E2;
    border: 1px solid #EF4444;
    border-radius: 8px;
    padding: 15px 20px;
    color: #991B1B;
    margin-top: 15px;
    display: none;
}

.error-box.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.error-link {
    color: #DC2626;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    margin-left: 5px;
}

.error-link:hover {
    color: #991B1B;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
