/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Утилиты */
.hidden {
    display: none !important;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, 
        rgba(30, 30, 40, 0.8) 0%, 
        rgba(50, 50, 60, 0.8) 50%, 
        rgba(30, 30, 40, 0.8) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton заголовка */
.skeleton-title {
    width: 280px;
    height: 56px;
    margin: 0 auto 30px;
    border-radius: 12px;
}

/* Skeleton аватара */
.skeleton-avatar {
    width: 180px;
    height: 180px;
    margin: 0 auto 25px;
    border-radius: 20px;
    border: 2px solid rgba(180, 50, 50, 0.2);
}

/* Skeleton bio */
.skeleton-bio {
    width: 200px;
    height: 24px;
    margin: 0 auto;
}

/* Skeleton ссылок */
.skeleton-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-link {
    height: 64px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(180, 50, 50, 0.1);
}

/* Анимация появления контента */
.fade-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

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

/* Плавное появление элементов профиля */
.brand-title:not(.hidden),
.avatar:not(.hidden),
.bio:not(.hidden) {
    animation: fadeIn 0.4s ease forwards;
}

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

body {
    font-family: 'Rajdhani', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    background-image: 
        radial-gradient(ellipse at center, rgba(30, 30, 50, 0.8) 0%, transparent 70%),
        linear-gradient(180deg, #0a0a0f 0%, #151520 50%, #0a0a0f 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect fill="%23111" width="100" height="100"/><circle fill="%23222" cx="50" cy="50" r="40"/></svg>');
    background-size: 300px 300px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Частицы */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(180, 50, 50, 0.6);
    border-radius: 50%;
    bottom: -10px;
    animation: floatUp 15s infinite linear;
    box-shadow: 0 0 10px rgba(180, 50, 50, 0.5);
}

.particle:nth-child(odd) {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Главная страница */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.brand-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 56px;
    font-weight: 900;
    color: transparent;
    background: linear-gradient(180deg, #3a3a4a 0%, #1a1a25 100%);
    -webkit-background-clip: text;
    background-clip: text;
    letter-spacing: 12px;
    margin-bottom: 30px;
    text-shadow: 0 0 60px rgba(100, 100, 120, 0.3);
    position: relative;
}

.brand-title::before {
    content: 'DEZOLATOR';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #5a5a6a 0%, #2a2a35 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: blur(2px);
    opacity: 0.5;
    z-index: -1;
}

.avatar {
    width: 180px;
    height: 180px;
    background: linear-gradient(145deg, rgba(180, 50, 50, 0.2), rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(180, 50, 50, 0.4);
    box-shadow: 
        0 0 40px rgba(180, 50, 50, 0.2),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.avatar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(180, 50, 50, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.avatar-icon {
    font-size: 70px;
    filter: drop-shadow(0 0 20px rgba(180, 50, 50, 0.5));
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.name {
    font-family: 'Orbitron', sans-serif;
    color: #e8e8e8;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.8);
    letter-spacing: 8px;
}

.bio {
    color: rgba(180, 50, 50, 0.9);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.glow-line {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(180, 50, 50, 0.8), transparent);
    margin: 25px auto 0;
    box-shadow: 0 0 15px rgba(180, 50, 50, 0.5);
}

/* Ссылки */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-button {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(145deg, rgba(30, 30, 40, 0.9), rgba(20, 20, 30, 0.95));
    border-radius: 12px;
    text-decoration: none;
    color: #e0e0e0;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(180, 50, 50, 0.2);
    position: relative;
    overflow: hidden;
}

.link-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(180, 50, 50, 0.1), transparent);
    transition: left 0.5s ease;
}

.link-button:hover::before {
    left: 100%;
}

.link-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 30px rgba(180, 50, 50, 0.3),
        0 0 20px rgba(180, 50, 50, 0.2);
    border-color: rgba(180, 50, 50, 0.5);
    background: linear-gradient(145deg, rgba(40, 40, 55, 0.95), rgba(25, 25, 35, 0.98));
}

.link-button:active {
    transform: translateY(0) scale(0.98);
}

.link-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(180, 50, 50, 0.4));
}

.link-title {
    flex: 1;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1px;
}

.no-links {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    padding: 40px;
    background: rgba(30, 30, 40, 0.5);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(180, 50, 50, 0.2);
}

/* Футер */
.footer {
    margin-top: 40px;
    text-align: center;
}

.admin-link {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 14px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-link:hover {
    background: rgba(180, 50, 50, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(180, 50, 50, 0.4);
}

/* ============================================
   АДМИН-ПАНЕЛЬ
   ============================================ */

.admin-body {
    background: #0a0a0f;
    background-image: 
        radial-gradient(ellipse at center, rgba(30, 30, 50, 0.8) 0%, transparent 70%),
        linear-gradient(180deg, #0a0a0f 0%, #151520 50%, #0a0a0f 100%);
}

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

.admin-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(180, 50, 50, 0.3);
}

.admin-header h1 {
    color: white;
    font-size: 24px;
    flex: 1;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

.back-button {
    color: rgba(180, 50, 50, 0.9);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    background: rgba(180, 50, 50, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(180, 50, 50, 0.3);
}

.back-button:hover {
    background: rgba(180, 50, 50, 0.2);
    box-shadow: 0 0 15px rgba(180, 50, 50, 0.3);
}

/* Секции */
.form-section,
.links-section,
.profile-section {
    background: rgba(20, 20, 30, 0.8);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(180, 50, 50, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.form-section h2,
.links-section h2,
.profile-section h2 {
    color: white;
    font-size: 20px;
    margin-bottom: 25px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.login-header h1 {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 3px;
}

/* Форма */
.link-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 16px 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(180, 50, 50, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(180, 50, 50, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.emoji-option {
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.emoji-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* Кнопки */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #8b2020 0%, #b43232 100%);
    color: white;
    border: 1px solid rgba(180, 50, 50, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(180, 50, 50, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Список ссылок в админке */
.admin-links-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.link-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 200px;
}

.link-info .link-icon {
    font-size: 32px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
}

.link-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.link-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.link-url {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    word-break: break-all;
}

.link-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-edit {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 12px 20px;
    font-size: 14px;
}

.btn-edit:hover {
    background: rgba(102, 126, 234, 0.3);
}

.btn-delete {
    background: rgba(234, 84, 85, 0.2);
    color: #ea5455;
    padding: 12px 20px;
    font-size: 14px;
}

.btn-delete:hover {
    background: rgba(234, 84, 85, 0.3);
}

.btn-move {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 16px;
    font-size: 14px;
}

.btn-move:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Адаптив */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .brand-title {
        font-size: 32px;
        letter-spacing: 6px;
    }
    
    .name {
        font-size: 28px;
        letter-spacing: 4px;
    }
    
    .avatar {
        width: 140px;
        height: 140px;
    }
    
    .container {
        padding: 30px 15px;
    }
    
    .link-button {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-link-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .link-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   СТРАНИЦА ВХОДА
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: rgba(20, 20, 30, 0.9);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(180, 50, 50, 0.3);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(180, 50, 50, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
}

.login-header h1 {
    color: white;
    font-size: 24px;
    font-weight: 600;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.error-message {
    background: rgba(234, 84, 85, 0.2);
    color: #ea5455;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
}

.btn-full {
    width: 100%;
}

.back-link {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    margin-top: 20px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: white;
}

.login-hint {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.login-hint p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 5px;
}

.login-hint code {
    background: rgba(180, 50, 50, 0.2);
    color: #b43232;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* Анимация встряхивания */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Кнопка выхода */
.btn-logout {
    background: rgba(234, 84, 85, 0.2);
    color: #ea5455;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(234, 84, 85, 0.3);
}

/* Секция безопасности */
.security-section {
    background: rgba(20, 20, 30, 0.8);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(180, 50, 50, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.security-section h2 {
    color: white;
    font-size: 20px;
    margin-bottom: 25px;
}

/* ============================================
   ЗАГРУЗКА АВАТАРА
   ============================================ */

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 40px;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-upload {
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* Аватар на главной странице */
.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

/* ========== СТАТИСТИКА ========== */

.stats-section {
    margin-top: 30px;
}

.stats-container {
    background: rgba(180, 50, 50, 0.05);
    border: 1px solid rgba(180, 50, 50, 0.2);
    border-radius: 15px;
    padding: 25px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(180, 50, 50, 0.15), rgba(20, 10, 10, 0.8));
    border: 1px solid rgba(180, 50, 50, 0.3);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(180, 50, 50, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(200, 80, 80, 1);
    text-shadow: 0 0 20px rgba(180, 50, 50, 0.5);
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-links,
.stats-history {
    margin-top: 25px;
}

.stats-links h3,
.stats-history h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    color: rgba(200, 80, 80, 0.9);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.link-stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(20, 10, 10, 0.6);
    border: 1px solid rgba(180, 50, 50, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.link-stat-item:hover {
    background: rgba(180, 50, 50, 0.1);
    border-color: rgba(180, 50, 50, 0.4);
}

.link-stat-icon {
    font-size: 1.3rem;
}

.link-stat-title {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.link-stat-clicks {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    color: rgba(200, 80, 80, 1);
    background: rgba(180, 50, 50, 0.15);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stats-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 10, 10, 0.6);
    border: 1px solid rgba(180, 50, 50, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
}

.history-date {
    font-family: 'Orbitron', monospace;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    min-width: 80px;
}

.history-stats {
    display: flex;
    gap: 20px;
}

.history-visits,
.history-clicks {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: rgba(200, 80, 80, 0.9);
}

.stats-container .btn-delete {
    margin-top: 25px;
    width: 100%;
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .history-stats {
        gap: 10px;
    }
}
