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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

/* Decorative Background Elements */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    pointer-events: none;
    animation: float 20s infinite ease-in-out;
    z-index: 0; /* ВАЖНО: задний план */
}

body::before {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -150px;
}

body::after {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -100px;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    padding: 0 20px 40px;
}

/* Logout Button */
.logout-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    color: #d32f2f;
    border: 2px solid rgba(211, 47, 47, 0.3);
    padding: 12px 24px;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: #d32f2f;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(211, 47, 47, 0.4);
    border-color: #d32f2f;
}

.logout-btn:active {
    transform: translateY(-1px);
}

/* Main Title */
h1 {
    color: white;
    text-align: center;
    font-size: 2.8em;
    margin-bottom: 50px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Presentation Card */
.presentation-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 35px;
    border-radius: 25px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s ease-out backwards;
    animation-delay: calc(var(--card-index, 0) * 0.1s);
}

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

.presentation-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.card-header h3 {
    color: #2c3e50;
    font-size: 1.6em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.form-group input,
input[type="text"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

input[type="file"] {
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    position: relative;
}

input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin-right: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

input[type="file"]::file-selector-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

/* Button Group */
.button-group {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 15px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(56, 239, 125, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* File List */
.file-list {
    list-style: none;
    padding: 10px;
    margin: 20px 0;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(248, 249, 250, 0.5);
    backdrop-filter: blur(10px);
}

.file-list::-webkit-scrollbar {
    width: 10px;
}

.file-list::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.file-item {
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.9);
    margin: 8px 0;
    cursor: grab;
    transition: all 0.3s ease;
    border-radius: 12px;
    border: 2px solid transparent;
    font-size: 14px;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.file-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: #667eea;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.file-item:active {
    cursor: grabbing;
    opacity: 0.7;
    transform: scale(0.98);
}

/* Presentation URL */
.presentation-url {
    margin-top: 25px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 15px;
    border-left: 4px solid #667eea;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.presentation-url strong {
    color: #34495e;
    font-weight: 700;
    font-size: 14px;
}

.presentation-url code {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 14px;
    border-radius: 10px;
    color: #667eea;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(102, 126, 234, 0.2);
    display: inline-block;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.presentation-url code:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s ease-out;
}

.empty-state h3 {
    color: #34495e;
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: 700;
}

.empty-state p {
    color: #7f8c8d;
    font-size: 1.1em;
    line-height: 1.8;
}

.empty-state code {
    background: rgba(102, 126, 234, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    color: #667eea;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 30px;
    }

    .presentation-card {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .logout-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 10px 18px;
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .card-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .badge {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6em;
    }

    .presentation-card {
        padding: 20px 15px;
    }

    .file-list {
        max-height: 250px;
    }
}

/* Стили для кнопки удаления слайда в правом нижнем углу */
.slide-tile {
    position: relative;
    overflow: hidden;
}

.slide-delete-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.95), rgba(185, 28, 28, 0.95));
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    z-index: 30; /* Увеличиваем z-index чтобы была поверх overlay */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.slide-tile:hover .slide-delete-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.slide-delete-btn:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 1), rgba(185, 28, 28, 1));
    transform: translateY(0) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.slide-delete-btn:active {
    transform: translateY(2px) scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Исправляем overlay - уменьшаем высоту чтобы не перекрывать кнопку */
.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px; /* Фиксированная высота вместо padding */
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    padding: 8px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20; /* Меньше чем у кнопки удаления */
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.slide-tile:hover .slide-overlay {
    opacity: 1;
}

.slide-name {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    width: 100%;
}

/* Улучшаем видимость type badge */
.slide-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 25;
}

/* Улучшаем slide index */
.slide-index {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 25;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Анимация удаления слайда */
.slide-tile.removing {
    animation: slideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95) translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
        height: 0;
        margin: 0;
        padding: 0;
        border: none;
    }
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .slide-delete-btn {
        width: 32px;
        height: 32px;
        bottom: 8px;
        right: 8px;
        font-size: 14px;
    }

    .slide-overlay {
        height: 50px;
        padding: 6px 8px;
    }
}