﻿/* Media Queries and Responsive Adjustments */

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Profile summary container - fixes spacing issues */
.profile-summary-container {
    display: block;
    width: 100%;
    margin-bottom: 0;
    position: relative;
    clear: both;
    padding-bottom: 20px !important;
}

/* Ensure profile content aligns properly */
.profile-analytics-panel {
    text-align: left !important;
    width: 100%;
}

@media (max-width: 768px) {

    /* Fix security panel text wrapping */
    .security-content p {
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Remove fixed line breaks on mobile */
    .security-content br {
        display: none !important;
    }

    /* Ensure the security option takes full width */
    .security-option {
        width: 100% !important;
    }

    /* Make the security content container wrap properly */
    .security-content {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Force the professional tiers container to use column direction */
    div[style*="display: flex !important"][style*="justify-content: center !important"][style*="gap: 20px !important"] {
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Make tier cards full width by overriding the width and flex properties */
    .tier-card[style*="width: 350px"] {
        width: 100% !important;
        max-width: none !important;
        flex: none !important;
        margin: 1rem 0 !important;
    }

    /* Ensure the container doesn't restrict width */
    div[style*="display: flex !important"][style*="justify-content: center !important"][style*="gap: 20px !important"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 1rem !important;
        box-sizing: border-box !important;
    }

    /* Fix tier buttons with fixed width */
    .tier-button,
    button[type="submit"].tier-button,
    .tier-button.highlighted-button,
    a.tier-button,
    .price-section button {
        width: 100px !important;
        max-width: 100px !important;
        min-width: 100px !important;
        box-sizing: border-box !important;
        margin: 0.5rem auto !important;
        display: block !important;
        text-align: center !important;
        padding: 0.5rem 0.25rem !important;
    }

    /* Center the buttons */
    .button-container {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* Make price container align items center */
    .price-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Make the autochat length settings group wrap properly */
    .settings-form:has(#autochatLength) .settings-group {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }

    /* Make the slider take appropriate width */
    #autochatLength {
        flex: 1 1 auto !important;
        min-width: 60% !important;
        margin-right: 0.5rem !important;
    }

    /* Keep the value display compact */
    #autochatLengthValue {
        width: auto !important;
        min-width: 45px !important;
        text-align: right !important;
    }

    /* Make the Default button wrap to next line when needed */
    .settings-form:has(#autochatLength) .settings-group button.settings-button {
        margin-top: 0.75rem !important;
        margin-left: 0 !important;
        flex-basis: 100% !important;
    }

    /* Alternative selector in case :has is not supported */
    #autochatLength ~ button.settings-button {
        margin-top: 0.75rem !important;
        margin-left: 0 !important;
        flex-basis: 100% !important;
        width: 100% !important;
    }

    /* Make the font size settings group wrap properly */
    #fontSizeForm .settings-group {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }

        /* Make label take full width */
        #fontSizeForm .settings-group label {
            width: 100% !important;
            margin-bottom: 0.5rem !important;
        }

    /* Adjust the slider to take most of the width */
    #fontSizeForm #fontSize {
        flex: 1 1 auto !important;
        min-width: 60% !important;
        margin-right: 0.5rem !important;
    }

    /* Keep the value display compact */
    #fontSizeForm #fontSizeValue {
        width: auto !important;
        min-width: 45px !important;
        text-align: right !important;
    }

    /* Make the Default button wrap to next line when needed */
    #fontSizeForm button.settings-button {
        margin-top: 0.75rem !important;
        margin-left: 0 !important;
        flex-basis: 100% !important;
    }

    .settings-container {
        padding: 0 !important;
        margin: 0 !important;
    }
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
    .settings-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Dropdown conversations - hidden by default on desktop */
.dropdown-conversations {
    display: none;
}

/* Show and style on mobile */
@media (max-width: 768px) {
    .dropdown-conversations {
        display: block;
        border-top: 1px solid var(--border-color);
        padding-top: 0.5rem;
        margin-top: 0.5rem;
        overflow-y: auto;
    }

    /* Individual conversation items in dropdown */
    .dropdown-conversation-item {
        display: block;
        padding: 0.75rem 1rem;
        color: var(--text-primary);
        text-decoration: none;
        cursor: pointer;
    }

        .dropdown-conversation-item:last-child {
            border-bottom: none;
        }

        .dropdown-conversation-item:hover {
            background-color: var(--element-hover);
        }

        .dropdown-conversation-item.active {
            background-color: var(--bg-secondary);
            font-weight: 600;
        }
}

/* Hide on mobile */
@media (max-width: 1024px) {
    .right-info .sentiment-emoji,
    .right-info .label-frame > .user-name:nth-of-type(2) {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .right-info .label-frame {
        display: none !important;
    }
}

/* Hide avatar on mobile for all users — frees toolbar space. */
@media (max-width: 768px) {
    .right-info > .avatar,
    .right-info .avatar-popup-wrapper {
        display: none;
    }
}

