/* --- Стили для загрузчика --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    opacity: 1;
    visibility: visible;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-logo {
    width: 100px;
    height: 100px;
    position: relative;
    animation: pulse 2.5s infinite ease-in-out;
}

.preloader-logo::before,
.preloader-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.preloader-logo::before {
    animation: rotate-cw 8s linear infinite;
}

.preloader-logo::after {
    transform: scale(0.7);
    animation: rotate-ccw 8s linear infinite;
}

.preloader-text {
    margin-top: 20px;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    letter-spacing: 3px;
    opacity: 0;
    animation: fadeInText 2s ease-in-out 0.5s infinite alternate;
}

@keyframes rotate-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-ccw {
    from { transform: rotate(0deg) scale(0.7); }
    to { transform: rotate(-360deg) scale(0.7); }
}

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

@keyframes fadeInText {
     from { opacity: 0.5; }
    to { opacity: 1; }
}
/* --- Конец стилей для загрузчика --- */


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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

/* Видео фон */
#videoBackground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    display: none;
}

.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.star-particle {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    pointer-events: none;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

.container {
    text-align: center;
    z-index: 10;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
}

.logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

h1 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    word-wrap: break-word;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
}

.link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.8rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.link-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    object-fit: contain;
}

.info-block {
    z-index: 10;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    text-align: center;
}

.info-block h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.info-block p {
    font-size: 1rem;
    line-height: 1.5;
}

.info-block a {
    color: #4dabf7;
    text-decoration: none;
    transition: color 0.3s;
}

.info-block a:hover {
    color: #74c0fc;
    text-decoration: underline;
}

.star-container {
    position: fixed;
    bottom: 15px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.star {
    width: 35px;
    height: 35px;
    position: relative;
    animation: glow 1.5s ease-in-out infinite alternate;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.star:hover {
    transform: scale(1.2);
}

.star:before {
    content: "✧";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 35px;
    text-align: center;
    line-height: 35px;
}

@keyframes glow {
    0% { 
        color: white;
        text-shadow: 0 0 5px #ffd700, 0 0 20px #ffaa00;
    }
    100% { 
        color: #ffff00;
        text-shadow: 0 0 15px #ffff00, 0 0 30px #ffaa00;
    }
}

.secret-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.5s ease;
    opacity: 0.15;
}

.secret-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
    opacity: 0.25;
}

.secret-btn:active {
    transform: scale(0.98);
}

.secret-btn::before {
    content: "";
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.favorite-container {
    position: fixed;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.favorite-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: scale(1.1);
}

.favorite-btn:active {
    transform: scale(0.95);
}

.favorite-btn::before {
    content: "❤";
    font-size: 22px;
    color: #ff5555;
}

.like-counter {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-counter::before {
    content: "✧.*";
    color: #ff5555;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 15px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 1.5rem;
    width: 100%;
    max-width: 500px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    margin: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group input, .input-group textarea, .input-group select {
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
}

.input-group textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.modal-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.7rem;
    border-radius: 8px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

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

.modal-btn:hover {
    opacity: 0.8;
}

.editor-container {
    display: none;
    margin-top: 1.5rem;
}

.editor-container.active {
    display: block;
}

.editor-group {
    margin-bottom: 1rem;
}

.editor-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.editor-group input, .editor-group textarea, .editor-group select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
}

.editor-group textarea {
    min-height: 70px;
    resize: vertical;
}

.editor-group .link-pair {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor-group .link-pair input {
    flex: 1;
}

.font-style-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.font-style-btn {
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.font-style-btn.active {
    background: rgba(255, 255, 255, 0.3);
}

.font-family-select {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.text-format-menu {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 5px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.text-format-menu.active {
    opacity: 1;
    pointer-events: all;
}

.text-format-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

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

/* Стили для вкладок */
.tabs {
    display: flex;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
}

.tab-btn {
    padding: 0.7rem 1rem;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab-btn.active {
    border-bottom: 2px solid white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.add-link-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

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

.link-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.remove-link-btn {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff5555;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    transition: all 0.3s;
}

.remove-link-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}

.logo-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.logo-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
}

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

.upload-btn {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

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

#logoUpload {
    display: none;
}

.remove-logo-btn {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff5555;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.remove-logo-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}

/* Стили для текстуры текста */
.texture-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.texture-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    background-size: cover;
    background-position: center;
}

.remove-texture-btn {
    margin-top: 5px;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff5555;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.remove-texture-btn:hover {
    background: rgba(255, 0, 0, 0.3);
}

.text-with-texture {
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    background-size: cover !important;
    background-position: center !important;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 400px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .info-block h2 {
        font-size: 1.3rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .tab-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .logo-container {
        width: 100px;
        height: 100px;
    }
}
