/**
 * Styles för Regelboks AI
 * Modern design med hockey-tema - Matchar startsidan
 */

:root {
    --primary-color: #1e3c72;
    --primary-dark: #152d56;
    --primary-light: #2a5298;
    --primary-bright: #3d6bb3;
    --secondary-color: #ff6b35;
    --secondary-light: #ff8c5a;
    --accent-color: #f7931e;
    --accent-light: #ffb347;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;
    --bg-light: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.2);
    --shadow-colored: 0 8px 24px rgba(30, 60, 114, 0.2);
    --max-width: 1200px;
    --spacing: 20px;
    
    --user-message-bg: #1e3c72;
    --user-message-text: #ffffff;
    --ai-message-bg: #f0f4f8;
    --ai-message-text: #333333;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-white);
    font-size: 16px;
    min-height: 100vh;
}

/* Header styles kommer från ../styles.css - dessa är bara override för att säkerställa konsistens */
.logo {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.logo-text {
    white-space: nowrap !important;
}

.main-nav {
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
}

.nav-link {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Chat Page Container - EXAKT kopierad från .hero */
.chat-page-container {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    color: white;
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
    display: flex;
    flex-direction: column;
}

.chat-page-background-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
}

.chat-page-background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(21, 45, 86, 0.8) 0%, rgba(30, 60, 114, 0.7) 50%, rgba(42, 82, 152, 0.6) 100%);
}

.chat-page-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: shimmer 20s linear infinite;
    opacity: 0.3;
}

.chat-page-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 50m-40 0a40 40 0 1 1 80 0a40 40 0 1 1 -80 0' stroke='%23ffffff' stroke-width='0.5' fill='none' opacity='0.1'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.chat-page-container > .chat-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    padding: 0 2rem;
    align-items: flex-start;
}

.chat-ad-sidebar {
    flex-shrink: 0;
    width: 300px;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

.chat-ad-mobile {
    display: none;
}

.chat-ad-sidebar .sponsor-sidebar {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-ad-sidebar .sponsor-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chat-ad-sidebar .sponsor-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    text-align: center;
}

.chat-ad-sidebar .sponsor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.chat-ad-sidebar .sponsor-content img:hover {
    transform: scale(1.02);
}

.chat-ad-sidebar .sponsor-placeholder {
    min-height: 600px;
    padding: 2rem;
}

.chat-ad-sidebar .sponsor-content > div,
.chat-ad-sidebar .sponsor-content .adsbygoogle {
    width: 100%;
}

.chat-ad-sidebar .sponsor-content .adsbygoogle {
    display: block;
    margin: 0 auto;
}

/* Ad Spaces */
.sponsor-space {
    padding: 2.5rem 0;
    background: var(--bg-gradient);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.sponsor-top {
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.95) 0%, rgba(233, 236, 239, 0.95) 100%);
    backdrop-filter: blur(10px);
}

.sponsor-top .sponsor-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    width: 100%;
}

.sponsor-top .sponsor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sponsor-top-mobile {
    display: none;
}

.sponsor-top .sponsor-content > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

.sponsor-top .sponsor-content [data-ad-type="sponsored"] {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.sponsor-top .sponsor-content .adsbygoogle {
    display: block;
    width: 100%;
    max-width: 970px;
    aspect-ratio: 970 / 280;
    min-height: 100px;
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
}

.sponsor-top .sponsor-content .adsbygoogle iframe,
.sponsor-top .sponsor-content .adsbygoogle > div {
    max-width: 100%;
    width: 100% !important;
    height: 100% !important;
}

.sponsor-top .sponsor-content .adsbygoogle > div {
    display: flex;
    justify-content: center;
    position: relative !important;
    min-height: 100px;
}

.sponsor-top .sponsor-content .adsbygoogle iframe {
    position: static !important;
    display: block;
    margin: 0 auto;
}

.sponsor-top .sponsor-content img:hover {
    transform: scale(1.02);
}

.chat-container {
    flex: 1;
    max-width: 1000px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    max-height: 900px;
    position: relative;
    z-index: 1;
    transition: box-shadow 0.3s ease;
}

.chat-container:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chat-header-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 2rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.chat-background-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.chat-background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.85) 0%, rgba(42, 82, 152, 0.75) 100%);
}

.chat-header-content {
    position: relative;
    z-index: 1;
}

.chat-header-section h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.chat-header-section .subtitle {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 400;
}

.controls-panel {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-group label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.control-select {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.control-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.control-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.15);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: var(--bg-white);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    animation: fadeInUp 0.6s ease-out;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.5) 0%, rgba(240, 244, 248, 0.5) 100%);
    border-radius: 12px;
    margin: 1rem 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.welcome-message p {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.hint {
    font-size: 0.95rem;
    font-style: italic;
    opacity: 0.8;
    color: var(--text-light);
}

.message {
    display: flex;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.3s ease-in;
}

.user-message {
    justify-content: flex-end;
    align-items: flex-end;
}

.ai-message {
    justify-content: flex-start;
    flex-direction: column;
    align-items: flex-start;
}

.message-content {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    line-height: 1.7;
    font-size: 0.95rem;
    word-wrap: break-word;
    box-shadow: var(--shadow);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--user-message-bg) 0%, var(--primary-light) 100%);
    color: var(--user-message-text);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.2);
}

.ai-message .message-content {
    background: linear-gradient(135deg, var(--ai-message-bg) 0%, #f8fafc 100%);
    color: var(--ai-message-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

/* Loading indicator */
.loading .message-content {
    background: var(--ai-message-bg);
    padding: 1rem;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

.chat-input-container {
    padding: 1.5rem 2rem;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.chat-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 60px;
    max-height: 150px;
    line-height: 1.6;
    background: var(--bg-white);
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.message-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Prevent zoom on input focus on iOS */
@supports (-webkit-touch-callout: none) {
    .message-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1), 0 2px 8px rgba(30, 60, 114, 0.08);
    background: var(--bg-white);
}

.message-input:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

.send-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

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

.send-button:hover::before {
    left: 100%;
}

.send-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-bright) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
}

.send-button:active:not(:disabled) {
    transform: translateY(0);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Report button */
.report-button {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.report-button:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Report modal */
.report-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s;
    backdrop-filter: blur(4px);
}

.report-modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.3s ease-out;
}

.report-modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.report-modal-close:hover {
    color: var(--text-primary);
}

.report-modal-content h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
}

.report-modal-content > p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.report-modal-content .form-group {
    margin-bottom: 1.25rem;
}

.report-modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.report-modal-content input[type="email"],
.report-modal-content textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-modal-content input[type="email"]:focus,
.report-modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.report-modal-content textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-cancel,
.btn-submit {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-cancel {
    background: var(--bg-light);
    color: var(--text-primary);
}

.btn-cancel:hover {
    background: var(--border-color);
}

.btn-submit {
    background: var(--primary-color);
    color: white;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.report-message-display {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
}

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

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

/* Responsive */
@media (max-width: 1024px) {
    .chat-page-container > .chat-wrapper {
        max-width: 100%;
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .chat-ad-sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 0.75rem 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .header-content {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: center;
    }

    .logo {
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    .logo-icon img {
        width: 28px;
        height: 28px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
        width: 100%;
        order: 3;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    }


    .chat-page-container {
        padding: 0.5rem 0;
        min-height: calc(100vh - 60px);
    }

    .chat-page-container > .chat-wrapper {
        flex-direction: column;
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    /* Top ad section - make it more compact on mobile */
    .sponsor-top {
        padding: 1rem 0 !important;
        margin-bottom: 0.5rem;
    }

    .sponsor-top .sponsor-content {
        padding: 0.5rem;
    }

    .sponsor-top .sponsor-content img {
        max-height: 100px;
        width: auto;
        margin: 0 auto;
    }

    .sponsor-top-desktop {
        display: none;
    }

    .sponsor-top-mobile {
        display: block;
    }

    .sponsor-top .sponsor-content .adsbygoogle {
        aspect-ratio: 333 / 100;
        max-width: 100%;
    }

    /* Sidebar ad - make it visible and compact on mobile */
    .chat-ad-sidebar {
        width: 100%;
        position: static;
        order: 1;
    }

    .chat-ad-desktop {
        display: none;
    }

    .chat-ad-mobile {
        display: block;
    }

    .chat-ad-sidebar .sponsor-sidebar {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 0.5rem;
    }

    .chat-ad-sidebar .sponsor-content {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 150px;
    }

    .chat-ad-sidebar .sponsor-content img {
        max-width: 100%;
        max-height: 200px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .chat-ad-sidebar .adsbygoogle {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
        display: block;
    }

    .chat-ad-sidebar .adsbygoogle > div,
    .chat-ad-sidebar .adsbygoogle iframe {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto;
    }

    .chat-ad-sidebar .sponsor-placeholder {
        min-height: 150px;
        padding: 1rem;
    }

    /* Chat container - better mobile sizing */
    .chat-container {
        height: calc(100vh - 280px);
        min-height: 500px;
        border-radius: 12px;
        margin: 0;
        max-width: 100%;
        order: 2;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    .chat-header-section {
        padding: 1.25rem 1rem;
    }

    .chat-header-section h1 {
        font-size: 1.4rem;
        margin-bottom: 0.4rem;
    }

    .chat-header-section .subtitle {
        font-size: 0.85rem;
    }

    .credits-display {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
        margin-top: 0.75rem;
    }

    .controls-panel {
        padding: 0.875rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    .control-select {
        flex: 1;
    }

    .chat-messages {
        padding: 1rem 0.875rem;
        gap: 0.875rem;
    }

    .welcome-message {
        padding: 2rem 1rem;
    }

    .welcome-message p {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .hint {
        font-size: 0.85rem;
    }

    .message-content {
        max-width: 88%;
        font-size: 0.9rem;
        padding: 0.875rem 1rem;
        line-height: 1.6;
    }

    .chat-input-container {
        padding: 1rem 0.875rem;
        border-top: 1px solid var(--border-color);
    }

    .chat-form {
        flex-direction: row;
        gap: 0.75rem;
        align-items: flex-end;
    }

    .message-input {
        flex: 1;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        min-height: 50px;
        max-height: 120px;
        border-radius: 12px;
    }

    .send-button {
        min-width: 90px;
        width: auto;
        height: 50px;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .report-button {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
        margin-top: 0.5rem;
    }

    .report-modal-content {
        padding: 1.5rem 1.25rem;
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-cancel,
    .btn-submit {
        width: 100%;
        padding: 0.875rem 1.25rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .chat-page-container {
        padding: 0.25rem 0;
    }

    .chat-page-container > .chat-wrapper {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }

    .chat-container {
        height: calc(100vh - 250px);
        min-height: 450px;
        border-radius: 10px;
    }

    .chat-header-section {
        padding: 1rem 0.875rem;
    }

    .chat-header-section h1 {
        font-size: 1.25rem;
    }

    .chat-header-section .subtitle {
        font-size: 0.8rem;
    }

    .chat-messages {
        padding: 0.875rem 0.75rem;
    }

    .message-content {
        max-width: 90%;
        font-size: 0.85rem;
        padding: 0.75rem 0.875rem;
    }

    .chat-input-container {
        padding: 0.875rem 0.75rem;
    }

    .message-input {
        font-size: 0.85rem;
        padding: 0.75rem 0.875rem;
    }

    .send-button {
        min-width: 80px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .sponsor-top {
        padding: 0.75rem 0 !important;
    }

    .sponsor-top .sponsor-content {
        padding: 0.5rem;
    }

    .sponsor-top .sponsor-content img {
        max-height: 80px;
    }

    .sponsor-top .sponsor-content .adsbygoogle {
        aspect-ratio: 333 / 100;
    }

    .sponsor-top-mobile .adsbygoogle {
        max-width: 360px;
        width: 100%;
        margin: 0 auto;
        display: block;
    }

    .sponsor-top-mobile .adsbygoogle > div,
    .sponsor-top-mobile .adsbygoogle iframe {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto;
    }

    .chat-ad-sidebar .sponsor-sidebar {
        padding: 0.875rem;
        border-radius: 10px;
    }

    .chat-ad-sidebar .sponsor-content {
        min-height: 120px;
        padding: 0.5rem;
    }

    .chat-ad-sidebar .sponsor-content img {
        max-height: 150px;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-container {
        height: calc(100vh - 200px);
        min-height: 400px;
    }

    .chat-header-section {
        padding: 1rem 1.25rem;
    }

    .chat-header-section h1 {
        font-size: 1.3rem;
    }

    .sponsor-top {
        padding: 0.75rem 0 !important;
    }

    .sponsor-top .sponsor-content img {
        max-height: 70px;
    }

    .chat-ad-sidebar .sponsor-content {
        min-height: 100px;
    }

    .chat-ad-sidebar .sponsor-content img {
        max-height: 120px;
    }
}

/* Credits Display */
.credits-display {
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.credits-display.credits-low {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.credits-display.credits-ok {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.credits-display.credits-error {
    background: rgba(220, 53, 69, 0.15);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Payment Modal */
.payment-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s;
    backdrop-filter: blur(4px);
}

.payment-modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.3s ease-out;
}

.payment-modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
}

.payment-modal-close:hover {
    color: var(--text-primary);
}

.payment-modal-content h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: 700;
}

.payment-modal-content > p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.payment-info {
    background: rgba(30, 60, 114, 0.05);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(30, 60, 114, 0.1);
}

.payment-info p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.payment-info p:first-child {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.payment-info .small {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.btn-buy-credits {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), #1e4d8c);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.btn-buy-credits:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
}

.btn-buy-credits:active:not(:disabled) {
    transform: translateY(0);
}

.btn-buy-credits:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-error {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    color: #dc3545;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .credits-display {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .payment-modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .btn-buy-credits {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}
