* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #48bb78;
    --error: #fc8181;
    --error-bg: #fff5f5;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 10px 20px rgba(102, 126, 234, 0.3);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Декоративный фон */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

.container {
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

/* Логотип */
.logo {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-top: 5px;
    font-weight: 400;
}

/* Карточка */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.card-header p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

/* Форма */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#urlInput {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
    color: var(--text);
    background: var(--white);
}

#urlInput::placeholder {
    color: #ccc;
}

#urlInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

#urlInput:hover:not(:focus) {
    border-color: #ccc;
}

#submitBtn {
    padding: 14px 30px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

#submitBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#submitBtn:hover::before {
    left: 100%;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

#submitBtn:active {
    transform: translateY(0);
}

#submitBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Результат */
.result {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 20px;
    animation: slideIn 0.3s ease;
    border: 1px solid #e8e8e8;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.success-icon {
    font-size: 20px;
}

.short-url-container {
    margin-bottom: 15px;
}

.short-url-wrapper {
    display: flex;
    gap: 10px;
}

#shortUrl {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--primary);
    border-radius: var(--radius-xs);
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
    background: var(--white);
    font-family: 'Inter', monospace;
    letter-spacing: 0.5px;
}

.copy-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 140px;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

.copied-text {
    color: var(--success);
}

.stats {
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.stat-item {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.stat-label {
    font-weight: 500;
    white-space: nowrap;
}

.original-url {
    word-break: break-all;
    color: var(--text-lighter);
}

/* Ошибка */
.error {
    background: var(--error-bg);
    color: #c53030;
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    border: 1px solid #fed7d7;
    font-size: 14px;
}

.error-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

/* Фичи */
.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: white;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong {
    font-size: 14px;
    font-weight: 600;
}

.feature-text span {
    font-size: 12px;
    opacity: 0.8;
}

/* Футер */
.footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* Тосты */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .card {
        padding: 30px 25px;
    }
    
    .logo h1 {
        font-size: 28px;
    }
    
    .logo-icon {
        font-size: 40px;
    }
    
    .features {
        gap: 15px;
    }
    
    .feature {
        flex: 1 1 100%;
        max-width: 250px;
    }
}

@media (max-width: 600px) {
    .card {
        padding: 20px;
        border-radius: var(--radius-sm);
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #submitBtn {
        width: 100%;
    }
    
    .short-url-wrapper {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
    
    .features {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .feature {
        max-width: 100%;
        width: 100%;
    }
    
    .logo {
        margin-bottom: 30px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .logo-icon {
        font-size: 36px;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        transform: none;
        text-align: center;
        border-radius: var(--radius-xs);
    }
}

@media (max-width: 400px) {
    body {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    #urlInput {
        font-size: 14px;
        padding: 12px 14px;
    }
    
    #submitBtn {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* Анимация появления */
.card, .features, .footer {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.features {
    animation-delay: 0.2s;
}

.footer {
    animation-delay: 0.3s;
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Выделение текста */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary);
}