/* Стили для системы аутентификации */

/* Навигационные кнопки авторизации */
.nav-auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 0.5rem;
}

.nav-login-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.nav-login-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.nav-user-menu {
    position: relative;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 2px solid #f59e0b;
    border-radius: 25px;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-user-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    transform: translateY(-2px);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.nav-user-name {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 14px;
}

/* Модальные окна */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
}

.auth-modal-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.auth-modal.show .auth-modal-content {
    transform: scale(1) translateY(0);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.auth-modal-header h2 {
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin: 0;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-gray);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.auth-modal-close:hover {
    background: var(--light-gray);
    color: var(--primary-dark);
}

/* Формы авторизации */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form-group label {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 14px;
}

.auth-form-group input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.auth-form-group input::placeholder {
    color: var(--text-gray);
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 50px;
}

.auth-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}

.auth-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-btn-secondary {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn-secondary:hover {
    background: var(--primary-dark);
    color: white;
}

.auth-form-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.auth-form-footer p {
    color: var(--text-gray);
    margin: 0;
}

.auth-form-footer a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.auth-form-footer a:hover {
    text-decoration: underline;
}

/* Профильное модальное окно */
.profile-modal .auth-modal-content {
    max-width: 600px;
    width: 95%;
}

.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light-gray);
}

.profile-tab {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-gray);
    transition: all 0.3s ease;
    position: relative;
}

.profile-tab.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

.profile-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border-radius: 15px;
    border: 2px solid var(--gold);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}

.profile-details h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.profile-details p {
    margin: 0 0 0.5rem 0;
    color: var(--text-gray);
}

.profile-role {
    background: var(--gold);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.profile-actions button {
    flex: 1;
}

/* Бронирования в профиле */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.booking-card {
    border: 2px solid var(--light-gray);
    border-radius: 15px;
    padding: 1.5rem;
    background: white;
    transition: all 0.3s ease;
}

.booking-card:hover {
    border-color: var(--gold);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.1);
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.booking-header h4 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.25rem;
}

.booking-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fef3cd;
    color: #856404;
}

.status-confirmed {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.booking-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.booking-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--text-gray);
}

.booking-details i {
    color: var(--gold);
    width: 16px;
}

.empty-state {
    text-align: center;
    color: var(--text-gray);
    font-style: italic;
    padding: 2rem;
}

/* Анимации загрузки */
.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-auth-buttons {
        gap: 0.5rem;
    }

    .nav-user-name {
        display: none;
    }

    .nav-user-btn {
        padding: 0.25rem;
        min-height: 44px;
        min-width: 44px;
    }

    .auth-modal-content {
        padding: 1.5rem;
        margin: 1rem;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .profile-modal .auth-modal-content {
        width: calc(100% - 2rem);
        margin: 1rem;
    }

    .profile-user-info {
        flex-direction: column;
        text-align: center;
    }

    .profile-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .profile-actions button {
        width: 100%;
    }

    .profile-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .profile-tab {
        flex: 1;
        min-width: 100px;
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 14px;
    }

    /* Все input элементы touch-friendly */
    .auth-form-group input,
    .auth-form-group select,
    .auth-form-group textarea {
        font-size: 16px;
        /* Prevent iOS zoom */
        min-height: 48px;
        padding: 0.875rem 1rem;
    }

    .auth-btn-primary {
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-modal-content {
        padding: 1rem;
        border-radius: 0;
        width: 100%;
        height: 100vh;
        margin: 0;
        max-height: none;
    }

    .auth-modal-header {
        padding: 1rem 0;
        margin-bottom: 1.5rem;
    }

    .auth-modal-header h2 {
        font-size: 1.25rem;
    }

    .auth-form {
        gap: 1rem;
    }

    .auth-form-group {
        margin-bottom: 1rem;
    }

    .auth-form-group input,
    .auth-form-group select {
        font-size: 16px;
        min-height: 50px;
        padding: 1rem;
    }

    .auth-btn-primary {
        min-height: 52px;
        font-size: 1.125rem;
        width: 100%;
    }

    .profile-user-info {
        gap: 1rem;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .profile-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .profile-tab {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .booking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .booking-details {
        font-size: 14px;
        line-height: 1.6;
    }

    .booking-card {
        padding: 1rem;
    }

    /* Fullscreen модал на мобиле */
    .auth-modal {
        padding: 0;
    }

    .auth-modal.show .auth-modal-content {
        animation: slideUp 0.3s ease-out;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}