/* static/connections/css/base.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

header {
    background: linear-gradient(to bottom right, #393EB4 40%, #8F39B4 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

/* Стили для неавторизованного пользователя */
.nav-left {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    padding-right: 30px;
}

.nav-center {
    flex-shrink: 0;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    padding-left: 30px;
}

/* Для авторизованного пользователя - обычное центрирование */
.nav-menu {
    gap: 30px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.logout-btn {
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 20px;
    cursor: pointer;
}

.logout-btn:hover {
    background-color: rgba(220, 53, 69, 0.8);
}

.login-btn {
    background-color: #28a745;
    color: white;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 30px;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.login-btn:hover {
    background-color: #218838;
    color: white;
    text-decoration: none;
}

main {
    flex: 1;
    padding: 40px 0;
}

footer {
    background: linear-gradient(to bottom right, #393EB4 40%, #8F39B4 100%);
    color: white;
    padding: 30px 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 0;
    color: #b39ddb;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-message {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Глобальный фон для всей страницы */
body {
    position: relative;
    overflow-x: hidden;
}

/* Декоративные фоновые элементы для всей страницы */
.global-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Карандаш */
.global-bg .shape-pencil {
    position: absolute;
    top: 8%;
    left: 3%;
    width: 100px;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23393EB4' opacity='0.10'%3E%3Cpath d='M16.28 2.28a1 1 0 0 0-1.41 0L12 5.17 9.13 2.28a1 1 0 0 0-1.41 0L2.28 7.72a1 1 0 0 0 0 1.41L5.17 12l-2.89 2.87a1 1 0 0 0 0 1.41l5.44 5.44a1 1 0 0 0 1.41 0L12 18.83l2.87 2.89a1 1 0 0 0 1.41 0l5.44-5.44a1 1 0 0 0 0-1.41L18.83 12l2.89-2.87a1 1 0 0 0 0-1.41l-5.44-5.44zM12 14.83L9.17 12 12 9.17 14.83 12 12 14.83z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: float 6s ease-in-out infinite;
}

/* Линейка */
.global-bg .shape-ruler {
    position: absolute;
    bottom: 12%;
    right: 2%;
    width: 120px;
    height: 120px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238F39B4' opacity='0.12'%3E%3Cpath d='M3 5v14h18V5H3zm16 12H5V7h14v10zM7 9h2v2H7V9zm4 0h2v2h-2V9zm4 0h2v2h-2V9zM7 13h2v2H7v-2zm4 0h2v2h-2v-2zm4 0h2v2h-2v-2z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: float 8s ease-in-out infinite reverse;
}

/* Циркуль */
.global-bg .shape-compass {
    position: absolute;
    top: 25%;
    right: 5%;
    width: 80px;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23393EB4' opacity='0.14'%3E%3Cpath d='M12 2L8 10h8l-4-8zm-2 12v4H4v2h16v-2h-6v-4h-4z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: float 7s ease-in-out infinite;
}

/* Книга */
.global-bg .shape-book {
    position: absolute;
    bottom: 18%;
    left: 5%;
    width: 100px;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238F39B4' opacity='0.10'%3E%3Cpath d='M4 6h16v12H4zM2 4v14h20V4H2z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: float 9s ease-in-out infinite reverse;
}

/* Треугольник */
.global-bg .shape-triangle-1 {
    position: absolute;
    top: 60%;
    left: -40px;
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 140px solid rgba(57, 62, 180, 0.04);
    transform: rotate(15deg);
}

.global-bg .shape-triangle-2 {
    position: absolute;
    top: 15%;
    right: -30px;
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 100px solid rgba(143, 57, 180, 0.04);
    transform: rotate(-20deg);
}

/* Круги */
.global-bg .shape-circle-1 {
    position: absolute;
    top: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(57, 62, 180, 0.03), rgba(143, 57, 180, 0.03));
}

.global-bg .shape-circle-2 {
    position: absolute;
    bottom: -120px;
    left: -120px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(57, 62, 180, 0.02), rgba(143, 57, 180, 0.02));
}

.global-bg .shape-circle-3 {
    position: absolute;
    top: 40%;
    left: 30%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid rgba(57, 62, 180, 0.03);
}

/* Ромбы */
.global-bg .shape-diamond-1 {
    position: absolute;
    top: 30%;
    left: 15%;
    width: 60px;
    height: 60px;
    background: rgba(57, 62, 180, 0.04);
    transform: rotate(45deg);
    animation: float 5s ease-in-out infinite;
}

.global-bg .shape-diamond-2 {
    position: absolute;
    bottom: 35%;
    right: 18%;
    width: 40px;
    height: 40px;
    background: rgba(143, 57, 180, 0.05);
    transform: rotate(45deg);
    animation: float 7s ease-in-out infinite reverse;
}

/* Квадраты */
.global-bg .shape-square-1 {
    position: absolute;
    top: 50%;
    right: 25%;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(57, 62, 180, 0.04);
    transform: rotate(10deg);
    animation: pulse 4s ease-in-out infinite;
}

.global-bg .shape-square-2 {
    position: absolute;
    bottom: 10%;
    right: 35%;
    width: 30px;
    height: 30px;
    background: rgba(143, 57, 180, 0.03);
    transform: rotate(25deg);
}

/* Точки/кружочки */
.global-bg .shape-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(57, 62, 180, 0.15);
    border-radius: 50%;
}

.global-bg .shape-dot-1 {
    top: 20%;
    left: 20%;
    width: 6px;
    height: 6px;
}

.global-bg .shape-dot-2 {
    top: 45%;
    right: 30%;
    width: 3px;
    height: 3px;
}

.global-bg .shape-dot-3 {
    bottom: 30%;
    left: 40%;
    width: 5px;
    height: 5px;
}

.global-bg .shape-dot-4 {
    top: 70%;
    right: 15%;
    width: 4px;
    height: 4px;
}

.global-bg .shape-dot-5 {
    bottom: 50%;
    left: 10%;
    width: 3px;
    height: 3px;
}

.floating-header {
    position: relative;
    top: 20px;
    margin: 0 20px 20px 20px;
    background: linear-gradient(to bottom right, #393EB4 40%, #8F39B4 100%);
    border-radius: 60px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(0px);
    z-index: 1000;
}

.floating-header .container {
    padding: 8px 20px;
}

.wavy-footer {
    position: relative;
    margin-top: 5px;
    background: linear-gradient(to bottom right, #393EB4 40%, #8F39B4 100%);
    color: white;
    clip-path: url(#waveClip);
}

.footer-content {
    padding: 7px 7px 5px;
    text-align: center;
    font-size: 12px;
}

.footer-content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
}

/* Анимации */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) rotate(10deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1) rotate(10deg);
        opacity: 0.5;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 12px;
    }
    
    .nav-left, .nav-right {
        flex: none;
        padding: 0;
        justify-content: center;
    }
    
    .nav-left, .nav-center, .nav-right {
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .login-btn {
        padding: 6px 12px;
        font-size: 14px;
    }

    .floating-header {
        top: 10px;
        margin: 0 10px 10px 10px;
        border-radius: 30px;
    }
    
    .floating-header .container {
        padding: 5px 15px;
    }

    .wavy-footer {
        margin-top: 5px;
    }
    
    .footer-content {
        padding: 5px 7px 4px;
        font-size: 10px;
    }
}

@media (max-width: 600px) {
    .nav-link {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .login-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}