/* Modern animated styles */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --secondary: #0ea5e9;
    --success: #22c55e;
    --background: #f8fafc;
    --text: #1e293b;
}

/* Animated background */
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    color: var(--text);
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Modern form styling */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

input {
    width: 100%;
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    padding: 0 0.5rem;
    background: transparent;
    transition: all 0.3s ease;
    pointer-events: none;
}

input:focus ~ label,
input:not(:placeholder-shown) ~ label {
    top: -0.5rem;
    left: 0.8rem;
    font-size: 0.875rem;
    background: white;
    color: var(--primary);
}

/* Button animation with shine effect */
button {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

button:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

button:active::after {
    width: 400px;
    height: 400px;
}

/* Enhanced Result animation with shine */
.result {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.result::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 1.5s ease-out;
}

@keyframes shine {
    to {
        left: 100%;
    }
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Shortened URL styles */
.shortened-url {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.3s;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}

.shortened-url a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    flex-grow: 1;
    transition: color 0.3s ease;
}

.shortened-url a:hover {
    color: var(--primary-dark);
}

/* Enhanced QR Code animation */
.qr-code {
    perspective: 1000px;
    margin-top: 2rem;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.6s;
}

.qr-code-inner {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.qr-code-inner.flip {
    transform: rotateY(360deg);
}

.qr-code img {
    max-width: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 1rem;
}

/* URL status indicators */
.url-status {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.url-status::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.url-status.checking::before {
    background: #FCD34D;
    animation: pulse 1.5s infinite;
}

.url-status.available::before {
    background: #22C55E;
}

.url-status.taken::before {
    background: #EF4444;
}

/* Enhanced Copy button styles */
.copy-btn {
    background: var(--secondary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.copy-btn:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.copy-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.copy-btn:active::after {
    width: 200px;
    height: 200px;
}

/* Success message with enhanced animation */
.message {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    animation: fadeSlideDown 0.5s ease;
    position: relative;
    overflow: hidden;
}

.message.success {
    background: var(--success);
    color: white;
}

/* Copied message animation */
.copied-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: #22C55E;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.copied-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Animation keyframes */
@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Input validation styles */
input:invalid {
    border-color: #EF4444;
}

input:valid {
    border-color: #22C55E;
}