/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #bb86fc;
    --primary-dark: #9965f4;
    --primary-light: #d5b3ff;
    --secondary-color: #03dac6;
    --accent-color: #cf6679;
    --error-color: #ff5370;
    --success-color: #69f0ae;
    --background: #0f0f1e;
    --surface: #1a1a2e;
    --surface-elevated: #252542;
    --text-primary: #e1e1e6;
    --text-secondary: #a0a0b0;
    --border-color: #2d2d44;
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-raised: 0 8px 20px rgba(0,0,0,0.5);
    --shadow-elevated: 0 12px 32px rgba(0,0,0,0.6);
    --glow: 0 0 20px rgba(187, 134, 252, 0.3);
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #0f0f1e 100%);
    color: var(--text-primary);
    line-height: 1.6;
    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, rgba(187, 134, 252, 0.1) 0%, transparent 50%);
    animation: rotateBackground 30s linear infinite;
    pointer-events: none;
}

@keyframes rotateBackground {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.container {
    max-width: 600px;
    width: 100%;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-elevated), var(--glow);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(187, 134, 252, 0.2);
    animation: containerFadeIn 0.6s ease-out;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок */
header {
    text-align: center;
    padding: 40px 30px 30px;
    background: linear-gradient(135deg, #3d1f70 0%, #5a2d8f 50%, #028a7a 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

header h1 {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: titleFadeIn 0.8s ease-out;
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    font-size: 16px;
    font-weight: 300;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
    animation: subtitleFadeIn 1s ease-out;
}

@keyframes subtitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

/* Основная секция */
main {
    padding: 30px;
}

.description {
    margin-bottom: 24px;
    text-align: center;
}

.description p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Hero Nick Section */
.hero-nick-section {
    margin-bottom: 24px;
    animation: fadeIn 0.6s ease;
}

.nick-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nick-label .material-icons {
    font-size: 20px;
    color: var(--primary-color);
}

.nick-input {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--surface-elevated) 0%, rgba(37, 37, 66, 0.8) 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
    opacity: 0.7;
}

.nick-input:focus,
.nick-input.has-custom-value {
    color: var(--text-primary);
    opacity: 1;
}

.nick-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.nick-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3), 0 0 0 3px rgba(187, 134, 252, 0.2), 0 0 20px rgba(187, 134, 252, 0.3);
    background: linear-gradient(135deg, var(--surface-elevated) 0%, rgba(37, 37, 66, 0.9) 100%);
}

.nick-input:hover {
    border-color: var(--primary-light);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: linear-gradient(135deg, var(--surface-elevated) 0%, rgba(37, 37, 66, 0.8) 100%);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(187, 134, 252, 0.2), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    border-radius: 50%;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.15) 0%, rgba(37, 37, 66, 0.9) 100%);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 4px 20px rgba(187, 134, 252, 0.2);
    transform: translateY(-2px);
}

.drop-zone:hover::before {
    width: 400px;
    height: 400px;
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.25) 0%, rgba(37, 37, 66, 0.95) 100%);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: inset 0 2px 12px rgba(0,0,0,0.4), 0 8px 30px rgba(187, 134, 252, 0.4), var(--glow);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: inset 0 2px 12px rgba(0,0,0,0.4), 0 8px 30px rgba(187, 134, 252, 0.4);
    }
    50% {
        box-shadow: inset 0 2px 12px rgba(0,0,0,0.4), 0 8px 40px rgba(187, 134, 252, 0.6);
    }
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 64px;
    color: var(--primary-color);
    display: block;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(187, 134, 252, 0.4));
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.drop-zone-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.drop-zone-subtext {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Кнопка выбора файла */
.btn-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow), 0 0 15px rgba(187, 134, 252, 0.3);
    pointer-events: all;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-select::before {
    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;
}

.btn-select:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: var(--shadow-raised), 0 0 25px rgba(187, 134, 252, 0.5);
    transform: translateY(-3px);
}

.btn-select:hover::before {
    width: 300px;
    height: 300px;
}

.btn-select:active {
    transform: translateY(-1px);
}

.btn-select .material-icons {
    font-size: 20px;
}

/* Информация о файле */
.file-info {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, var(--surface-elevated) 0%, rgba(37, 37, 66, 0.6) 100%);
    border-radius: 12px;
    animation: fadeIn 0.5s ease;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-details .material-icons {
    font-size: 32px;
    color: var(--primary-color);
}

.file-text {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-all;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-remove:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.btn-remove .material-icons {
    font-size: 20px;
    color: var(--text-secondary);
}

/* Прогресс-бар */
.progress-container {
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, rgba(45, 45, 68, 0.8), rgba(37, 37, 66, 0.9));
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(187, 134, 252, 0.6);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 1.5s infinite;
}

@keyframes progressShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Статус обработки */
.processing-status {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, var(--surface-elevated) 0%, rgba(37, 37, 66, 0.8) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    animation: fadeIn 0.5s ease;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(187, 134, 252, 0.4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-icon {
    font-size: 32px;
    color: var(--success-color);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.processing-status.success {
    background: linear-gradient(135deg, rgba(105, 240, 174, 0.15) 0%, rgba(37, 37, 66, 0.8) 100%);
    border: 1px solid rgba(105, 240, 174, 0.3);
}

.processing-text {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
    animation: pulse-text 2s ease-in-out infinite;
}

.processing-status.success .processing-text {
    animation: none;
    color: var(--success-color);
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Сообщения */
.message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    animation: slideIn 0.5s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.success {
    background: linear-gradient(135deg, rgba(105, 240, 174, 0.2) 0%, rgba(105, 240, 174, 0.1) 100%);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
    border: 1px solid rgba(105, 240, 174, 0.3);
    display: block;
    box-shadow: 0 4px 12px rgba(105, 240, 174, 0.2), inset 0 2px 8px rgba(0,0,0,0.2);
}

.message.error {
    background: linear-gradient(135deg, rgba(255, 83, 112, 0.2) 0%, rgba(255, 83, 112, 0.1) 100%);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
    border: 1px solid rgba(255, 83, 112, 0.3);
    display: block;
    box-shadow: 0 4px 12px rgba(255, 83, 112, 0.2), inset 0 2px 8px rgba(0,0,0,0.2);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    padding: 20px 30px;
    text-align: center;
}

.version {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 300;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.version:hover {
    opacity: 0.8;
}

/* Адаптивность */
@media (max-width: 768px) {
    header {
        padding: 30px 20px 20px;
    }

    header h1 {
        font-size: 24px;
    }

    main {
        padding: 20px;
    }

    .drop-zone {
        padding: 30px 15px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .drop-zone-text {
        font-size: 16px;
    }
    
    footer {
        padding: 15px 20px;
    }
}

