:root {
    /* Color Palette */
    --bg-dark: #0f111a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    /* Variables */
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background */
.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.4);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.3);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 680px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.logo svg {
    color: var(--accent-secondary);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 0.8s ease-out;
    transition: transform var(--transition-speed);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* Form Styles */
.input-group {
    display: flex;
    gap: 1rem;
    position: relative;
}

input[type="url"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    transition: all var(--transition-speed);
    outline: none;
}

input[type="url"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

input[type="url"]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

button[type="submit"] {
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    padding: 0 1.75rem;
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
}

button[type="submit"]:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

button[type="submit"]:active {
    transform: scale(0.98);
}

button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Error Message */
.error-message {
    color: #ef4444;
    margin-top: 1rem;
    font-size: 0.9rem;
    padding-left: 0.5rem;
    transition: opacity var(--transition-speed);
}

/* Result Area */
.result-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    animation: fadeIn 0.5s ease-out forwards;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.result-container h3 {
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.short-url-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--accent-secondary);
    border-radius: 12px;
    padding: 1rem 1.5rem;
}

.short-url-box a {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    word-break: break-all;
    transition: color var(--transition-speed);
}

.short-url-box a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

#copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
}

#copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#copy-btn.copied {
    color: #10b981;
}

/* Utilities */
.hidden {
    display: none !important;
}

footer {
    margin-top: 4rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
    width: 100%;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-nav a:hover {
    color: var(--text-primary);
}

/* Typography for Text Pages */
.text-page {
    text-align: left;
}

.text-page header {
    text-align: center;
}

.content-section {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    color: var(--text-secondary);
    line-height: 1.7;
    animation: fadeInUp 0.8s ease-out;
}

.content-section h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section p {
    margin-bottom: 1.25rem;
}

.content-section ul, .content-section ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.content-section a {
    color: var(--accent-primary);
    text-decoration: none;
}

.content-section a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Layout Support */
@media (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .glass-card, .content-section {
        padding: 2rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
        max-width: 100%;
    }
    
    h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    button[type="submit"] {
        padding: 1rem;
        justify-content: center;
        width: 100%;
    }
    
    .short-url-box {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    
    .short-url-box a {
        font-size: 1.1rem;
        word-break: break-all;
    }
    
    .glass-card, .content-section {
        padding: 1.5rem;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 0.75rem;
    }
}
