/**
 * B1 Sex Gastenboek Frontend Styles
 * Design based on B1sex.nl - Modern, clean, professional with purple accent
 */

:root {
    --b1sex-primary: #CD1D6A;
    --b1sex-primary-dark: #A01654;
    --b1sex-primary-light: #E04890;
    --b1sex-secondary: #f5f5f5;
    --b1sex-text: #333333;
    --b1sex-text-light: #666666;
    --b1sex-border: #e0e0e0;
    --b1sex-success: #28a745;
    --b1sex-error: #dc3545;
    --b1sex-warning: #ffc107;
    --b1sex-white: #ffffff;
    --b1sex-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --b1sex-shadow-hover: 0 4px 16px rgba(122, 0, 223, 0.2);
    --b1sex-radius: 12px;
    --b1sex-radius-small: 8px;
}

/* Chat Wrapper */
.b1sex-chat-wrapper {
    max-width: 900px;
    margin: 40px auto;
    background: var(--b1sex-white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Chat Header */
.b1sex-chat-header {
    background: linear-gradient(135deg, var(--b1sex-primary) 0%, var(--b1sex-primary-dark) 100%);
    color: var(--b1sex-white);
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.b1sex-chat-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.b1sex-chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.b1sex-username {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

/* Chat Messages Area */
.b1sex-chat-messages {
    height: 550px;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(to bottom, #fafafa 0%, #ffffff 100%);
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.b1sex-chat-loading {
    text-align: center;
    color: var(--b1sex-text-light);
    padding: 60px 20px;
    font-size: 15px;
    font-weight: 500;
}

/* Individual Message */
.b1sex-message {
    max-width: 450px;
    min-width: 180px;
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.b1sex-message-bubble {
    background: var(--b1sex-white);
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
    display: block !important;
    min-height: 45px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.b1sex-message-bubble:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.b1sex-message.b1sex-message-own {
    align-self: flex-end;
    margin-left: auto;
}

.b1sex-message.b1sex-message-own .b1sex-message-bubble {
    background: linear-gradient(135deg, var(--b1sex-primary) 0%, var(--b1sex-primary-light) 100%);
    color: var(--b1sex-white);
    border: none;
    box-shadow: 0 4px 12px rgba(205, 29, 106, 0.25), 0 2px 4px rgba(205, 29, 106, 0.15);
}

.b1sex-message-header {
    margin-bottom: 10px;
}

.b1sex-message-username {
    font-weight: 700;
    font-size: 13px;
    color: var(--b1sex-primary);
    display: block;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.b1sex-message-own .b1sex-message-username {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.b1sex-message-text {
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    color: #2c3e50;
    display: block !important;
    min-height: 20px;
    margin-bottom: 8px;
    letter-spacing: -0.1px;
}

.b1sex-message-own .b1sex-message-text {
    color: var(--b1sex-white);
}

.b1sex-message-time {
    font-size: 11px;
    color: var(--b1sex-text-light);
    opacity: 0.5;
    display: block;
    text-align: right;
    margin-top: 6px;
    font-weight: 500;
}

.b1sex-message-own .b1sex-message-time {
    color: rgba(255, 255, 255, 0.75);
    opacity: 0.8;
}

/* Chat Input */
.b1sex-chat-input-wrapper {
    padding: 20px 24px 24px 24px;
    background: var(--b1sex-white);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.b1sex-chat-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.b1sex-chat-form textarea {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.b1sex-chat-form textarea:focus {
    outline: none;
    border-color: var(--b1sex-primary);
    box-shadow: 0 0 0 4px rgba(205, 29, 106, 0.1);
    background: #fafafa;
}

.b1sex-chat-char-count {
    text-align: right;
    font-size: 12px;
    color: var(--b1sex-text-light);
    margin-top: 8px;
    font-weight: 500;
}

/* Buttons */
.b1sex-btn {
    padding: 13px 28px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: -0.2px;
}

.b1sex-btn-primary {
    background: linear-gradient(135deg, var(--b1sex-primary) 0%, var(--b1sex-primary-dark) 100%);
    color: var(--b1sex-white);
    box-shadow: 0 4px 12px rgba(205, 29, 106, 0.25);
}

.b1sex-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(205, 29, 106, 0.35);
}

.b1sex-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(205, 29, 106, 0.25);
}

.b1sex-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.b1sex-btn-secondary {
    background: var(--b1sex-secondary);
    color: var(--b1sex-text);
}

.b1sex-btn-secondary:hover {
    background: var(--b1sex-border);
}

.b1sex-btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.b1sex-btn-full {
    width: 100%;
    justify-content: center;
}

.b1sex-send-btn {
    padding: 14px 24px;
    white-space: nowrap;
    min-width: 120px;
}

/* Desktop: Hide mobile-only icon */
.b1sex-btn-icon-only {
    display: none;
}

.b1sex-btn-text {
    display: inline;
}

.b1sex-btn-icon-only {
    display: none;
}

/* Typing Indicator */
.b1sex-typing-indicator {
    max-width: 450px;
    min-width: 80px;
    display: none;
    align-items: center;
    padding: 14px 18px;
    background: var(--b1sex-white);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.b1sex-typing-indicator.active {
    display: flex !important;
}

.b1sex-typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.b1sex-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--b1sex-primary);
    border-radius: 50%;
    animation: typingDotBounce 1.4s infinite ease-in-out;
}

.b1sex-typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.b1sex-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.b1sex-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Profile Modal */
.b1sex-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.b1sex-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.b1sex-modal {
    background: var(--b1sex-white);
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.b1sex-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.b1sex-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--b1sex-text);
}

.b1sex-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--b1sex-text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.b1sex-modal-close:hover {
    background: var(--b1sex-secondary);
    color: var(--b1sex-text);
}

.b1sex-modal-body {
    padding: 20px;
}

.b1sex-profile-section {
    margin-bottom: 16px;
}

.b1sex-profile-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--b1sex-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.b1sex-profile-info {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 0;
    border: 2px solid #f0f0f0;
}

.b1sex-profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.b1sex-profile-item:not(:last-child) {
    border-bottom: 1px solid #f5f5f5;
}

.b1sex-profile-label {
    font-size: 14px;
    color: var(--b1sex-text-light);
    font-weight: 500;
}

.b1sex-profile-value {
    font-size: 15px;
    color: var(--b1sex-text);
    font-weight: 600;
}

.b1sex-danger-zone {
    background: #fff5f5;
    border: 2px solid #fee;
    border-radius: 12px;
    padding: 20px;
}

.b1sex-danger-zone h4 {
    color: var(--b1sex-error);
    margin-bottom: 12px;
}

.b1sex-danger-zone p {
    font-size: 14px;
    color: #721c24;
    margin-bottom: 16px;
}

.b1sex-btn-danger {
    background: var(--b1sex-error);
    color: var(--b1sex-white);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b1sex-btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.b1sex-profile-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.b1sex-logout-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.b1sex-logout-btn svg,
.b1sex-profile-btn svg {
    pointer-events: none; /* Prevent SVG from blocking clicks */
}

/* Privacy Footer */
.b1sex-privacy-footer {
    padding: 16px 24px;
    background: #fafafa;
    text-align: center;
    font-size: 12px;
    color: var(--b1sex-text-light);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-weight: 500;
}

/* Auth Container (Login/Register combined) */
.b1sex-auth-container {
    padding: 30px 40px;
}

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

.b1sex-auth-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.b1sex-auth-header h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--b1sex-text);
}

.b1sex-auth-header .b1sex-privacy-notice {
    margin: 15px auto;
    max-width: 400px;
}

/* Auth Tabs */
.b1sex-auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--b1sex-border);
}

.b1sex-auth-tab {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--b1sex-text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.b1sex-auth-tab:hover {
    color: var(--b1sex-primary);
}

.b1sex-auth-tab.active {
    color: var(--b1sex-primary);
    border-bottom-color: var(--b1sex-primary);
}

/* Auth Content */
.b1sex-auth-content {
    animation: fadeIn 0.3s ease;
}

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

.b1sex-privacy-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 12px 20px;
    border-radius: var(--b1sex-radius-small);
    margin: 20px 0;
    font-size: 14px;
    color: #856404;
}

/* Auth Wrapper */
.b1sex-auth-wrapper {
    max-width: 450px;
    margin: 40px auto;
    padding: 20px;
}

.b1sex-auth-box {
    background: var(--b1sex-white);
    border-radius: var(--b1sex-radius);
    padding: 40px;
    box-shadow: var(--b1sex-shadow);
}

.b1sex-auth-box h2 {
    text-align: center;
    color: var(--b1sex-primary);
    margin-bottom: 10px;
    font-size: 28px;
}

.b1sex-auth-subtitle {
    text-align: center;
    color: var(--b1sex-text-light);
    margin-bottom: 30px;
    font-size: 14px;
}

/* Auth Forms */
.b1sex-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.b1sex-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--b1sex-text);
}

.b1sex-form-group input {
    padding: 12px 16px;
    border: 2px solid var(--b1sex-border);
    border-radius: var(--b1sex-radius-small);
    font-size: 14px;
    transition: all 0.3s ease;
}

.b1sex-form-group input:focus {
    outline: none;
    border-color: var(--b1sex-primary);
    box-shadow: 0 0 0 3px rgba(122, 0, 223, 0.1);
}

.b1sex-form-group small {
    font-size: 12px;
    color: var(--b1sex-text-light);
}

/* Messages */
.b1sex-message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    width: 100%;
    box-sizing: border-box;
    font-weight: 500;
    text-align: left;
}

.b1sex-message.b1sex-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

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

.b1sex-auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--b1sex-text-light);
}

.b1sex-auth-footer a {
    color: var(--b1sex-primary);
    text-decoration: none;
    font-weight: 600;
}

.b1sex-auth-footer a:hover {
    text-decoration: underline;
}

.b1sex-auth-notice {
    text-align: center;
    padding: 40px;
    background: var(--b1sex-white);
    border-radius: var(--b1sex-radius);
    box-shadow: var(--b1sex-shadow);
}

/* Error Message */
.b1sex-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    border-radius: var(--b1sex-radius-small);
    margin: 20px;
    text-align: center;
}

/* Scrollbar Styling */
.b1sex-chat-messages::-webkit-scrollbar {
    width: 10px;
}

.b1sex-chat-messages::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

.b1sex-chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--b1sex-primary) 0%, var(--b1sex-primary-dark) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.b1sex-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--b1sex-primary-dark);
    background-clip: padding-box;
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .b1sex-chat-form {
        align-items: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .b1sex-chat-wrapper {
        margin: 15px;
        border-radius: 12px;
    }

    .b1sex-chat-header {
        padding: 20px;
        flex-wrap: wrap;
    }

    .b1sex-chat-header h3 {
        font-size: 18px;
    }

    /* Mobile: Make profile/logout buttons more visible */
    .b1sex-chat-user-info {
        gap: 8px;
        padding: 6px 12px;
    }

    .b1sex-username {
        display: none; /* Hide username text on mobile, only show icons */
    }

    .b1sex-profile-btn,
    .b1sex-logout-btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .b1sex-profile-btn svg,
    .b1sex-logout-btn svg {
        width: 20px;
        height: 20px;
    }

    .b1sex-logout-btn {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }

    .b1sex-logout-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .b1sex-chat-messages {
        height: 450px;
        padding: 16px;
    }

    .b1sex-message {
        max-width: 280px;
        min-width: 120px;
    }

    .b1sex-message-text {
        font-size: 14px;
    }

    .b1sex-chat-input-wrapper {
        padding: 16px;
    }

    /* Mobile: Show only icon on send button */
    .b1sex-send-btn {
        min-width: auto;
        width: 50px;
        height: 50px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .b1sex-btn-text {
        display: none;
    }

    /* Only hide the icon inside send button, NOT logout button */
    .b1sex-send-btn .b1sex-btn-icon {
        display: none;
    }

    .b1sex-btn-icon-only {
        display: inline;
        font-size: 20px;
    }

    .b1sex-auth-box {
        padding: 30px 20px;
    }

    .b1sex-login-required {
        padding: 40px 20px;
    }

    .b1sex-login-required-actions {
        flex-direction: column;
    }

    .b1sex-typing-indicator {
        max-width: 280px;
    }
}
