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

/* Added for terms of service */
h1 {
    text-align: center; /* Centers the main header */
    margin-bottom: 1em; /* Adds extra space below the main header */
}

h2 {
    margin-top: 0.6em; /* Adds space above section headers */
    margin-bottom: 1em;
}

h3 {
    margin-top: 0.6em; /* Adds space above sub-headers */
    margin-bottom: 1em;
}

p, ul {
    margin-bottom: 1em; /* Adds space after each paragraph and list */
    /* line-height: 1.0;   Increases space between lines for readability */
}

/* Original styles start here */

body {
    font-family: 'Nunito', sans-serif;
    background-color: #1b1c1d;
    color: white;
    overflow-x: hidden;
}

.legal-links {
    margin-top: 8px;
}

.legal-link {
    display: block;
    font-size: 0.85em;
    color: inherit;
    text-decoration: none;
    margin-bottom: 4px;
    opacity: 0.8;
}

.legal-disclaimer {
    font-size: 0.8em;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.legal-disclaimer a {
    color: inherit;
    text-decoration: underline;
}

.legal-disclaimer a:hover {
    opacity: 0.8;
}

.legal-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Album Area Styles */
.album-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 15px;
}

.album-area::-webkit-scrollbar {
    width: 8px;
}

.album-area::-webkit-scrollbar-track {
    background-color: #2a2a2a;
    border-radius: 4px;
}

.album-area::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.album-area h3 {
    color: white;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    flex-shrink: 0; /* Prevent the header from shrinking */
}

.album-empty {
    text-align: center;
    color: #ccc;
    font-style: italic;
    padding: 40px 20px;
}

/* Make the album grid scrollable */
.album-grid {
    flex: 1;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    padding: 10px 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}

.album-area .album-image {
    width: 100% !important;
    aspect-ratio: 1 !important;
    background-color: #2a2a2a;
    border-radius: 8px !important;
    border: 2px solid #444 !important;
    object-fit: cover !important;
    transition: transform 0.3s ease, border-color 0.3s ease !important;
    cursor: pointer !important;
}

.album-area .album-image:hover {
    transform: scale(1.05) !important;
    border-color: #007bff !important;
}

/* Scrollbar styling for album grid */
.album-grid::-webkit-scrollbar {
    width: 8px;
}

.album-grid::-webkit-scrollbar-track {
    background-color: #2a2a2a;
    border-radius: 4px;
}

.album-grid::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .album-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: 10px !important;
    }

    .album-area {
        padding: 15px;
    }

    .album-area h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .album-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

/* Personality Traits Styling Fixes - Updated */
.personality-traits-header,
.personality-traits-section h3 {
    color: #007bff !important;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

.personality-trait-item {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 20px !important; /* Increased spacing between items */
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.trait-radio {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    flex-direction: row; /* Changed from column to row */
    gap: 10px; /* Increased gap between Yes and No */
    flex-shrink: 0; /* Prevent radio buttons from shrinking */
    min-width: 100px; /* Increased from 60px to accommodate both buttons */
}

.trait-radio label {
    color: white !important;
    font-size: 14px;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.trait-radio input[type="radio"] {
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.trait-content {
    flex: 1;
    color: white !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.trait-content strong {
    color: #007bff !important;
    font-weight: 600;
    font-size: 16px;
}

/* Remove any white backgrounds from trait containers */
.info-item .personality-trait-item,
.info-item .trait-radio,
.info-item .trait-content,
.trait-container,
.personality-traits-list {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remove any white backgrounds from trait containers */
.info-item .trait-item,
.info-item .trait-radio,
.trait-container {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}


/* FAQ Area Styles */
.faq-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 15px;
}

.faq-area h3 {
    color: white;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.faq-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 10px;
}

.faq-content::-webkit-scrollbar {
    width: 8px;
}

.faq-content::-webkit-scrollbar-track {
    background-color: #2a2a2a;
    border-radius: 4px;
}

.faq-content::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.faq-section {
    margin-bottom: 20px;
}

.faq-item-header {
    color: #007bff;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.faq-item-content {
    color: white;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .faq-area {
        padding: 15px;
    }

    .faq-area h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}

/* Share functionality styles */
.image-container {
    position: relative;
    display: inline-block;
}

.share-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.5; /* 50% opacity - adjust between 0.5-0.9 as desired */
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.share-icon:hover {
    background: rgba(0, 123, 255, 1);
    transform: scale(1.1);
    opacity: 1; /* Full opacity on hover for better interaction feedback */
}

/* Share popup styles */
.share-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.share-content {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #007bff;
    min-width: 300px;
    max-width: 90%;
    text-align: center;
}

.share-content h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.share-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.share-btn:hover {
    background: #0056b3;
}

.close-popup {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.close-popup:hover {
    background: #545b62;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .share-content {
        padding: 20px;
        min-width: 280px;
    }
    
    .share-buttons {
        gap: 10px;
    }
    
    .share-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    padding: 30px;
    border-radius: 10px;
    background-color: #000;
    border: 1px solid #fff;
}

.modal-header h2 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 400;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #333;
    color: white;
    font-size: 16px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 5px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Update the button styling section */
.btn-primary, .btn-secondary, .btn-create, .btn-info, .btn-send, .btn-album {
    padding: 5px 5px; /* Changed from 5px 5px */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    transition: background-color 0.3s;
}

/* Specific styling for the Album button */
.btn-album {
    background-color: #007bff;
    color: white;
    width: 300px; /* Match the progeny image width */
    margin-top: 10px;
    font-size: 14px;
}

.btn-album:hover {
    background-color: #0056b3;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-create {
    background-color: #007bff;
    color: white;
    width: 100%;
    margin-top: 10px;
    font-size: 14px;
}

.btn-info {
    background-color: #007bff;
    color: white;
    width: 95%;
    margin-top: 10px;
    font-size: 14px;
}

.btn-send {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
}

.progeny-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 300px; /* Keep this line */
}

/* Make sure btn-info buttons in progeny-buttons container stay smaller */
.progeny-buttons .btn-info {
    width: 100%;
    margin-top: 0;
    padding: 5px 5px; /* Consistent padding */
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
}

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

/* Mobile Menu Button - Hidden by default */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background-color: transparent;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    min-height: 50px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.mobile-menu-btn:active {
    transform: translateY(0);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Dashboard Styles */
.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Desktop Sidebar */
.sidebar {
    width: 20%;
    min-width: 250px;
    background-color: #282a2c;
    transition: width 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 100;
}

/* Desktop collapsed state */
.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

.sidebar.collapsed .sidebar-content {
    display: none;
}

.sidebar.collapsed .menu-toggle {
    text-align: center;
    width: 100%;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #404040;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    color: #007bff;
}

.sidebar-content {
    padding: 20px;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section h3 {
    margin-bottom: 15px;
    font-weight: 600;
    color: white;
}

.progeny-list {
    list-style: none;
    margin-bottom: 15px;
}

.progeny-list li {
    padding: 10px 0;
    border-bottom: 1px solid #404040;
}

.progeny-list a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.progeny-list a:hover, .progeny-list a.active {
    color: #007bff;
    font-weight: bold;
}

.account-section {
    margin-top: auto;
}

.account-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.account-section a:hover {
    color: white;
}

.main-content {
    flex: 1;
    background-color: #1b1c1d;
    padding: 20px;
    overflow: hidden;
    transition: margin-left 0.3s ease;
}

.progeny-display {
    display: flex;
    height: 100%;
    gap: 20px;
    overflow: hidden;
}

.progeny-image-container {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progeny-image {
    width: 300px;
    height: 300px;
    border: 2px solid #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
}

.progeny-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.no-image {
    color: #ccc;
    text-align: center;
    font-size: 16px;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Fixed Chat Area with proper scrolling */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    overflow-scrolling: touch;
    transform: translate3d(0,0,0); /* Force hardware acceleration */
}

.chat-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    align-self: flex-start;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s ease-out forwards;
    margin-bottom: 15px;
    line-height: 1.5;
    will-change: opacity, transform; /* For mobile optimization */
    backface-visibility: hidden; /* Prevent flickering */
}

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

.chat-message.user {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.progeny {
    background-color: #333;
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Fixed input container at bottom */
.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 20px;
    background-color: #2a2a2a;
    border-top: 1px solid #404040;
    flex-shrink: 0;
    align-items: center; /* Add this from the second one */
    position: relative; /* Add this for mobile z-index */
    z-index: 10; /* Add this for mobile visibility */
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #555;
    border-radius: 25px;
    background-color: #333;
    color: white;
    font-size: 16px;
    outline: none;
}

.chat-input:focus {
    border-color: #007bff;
}

.progeny-info, .account-info {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #2a2a2a;
    border-radius: 10px;
}

.progeny-info h3, .account-info h3 {
    margin-bottom: 20px;
    font-weight: 600;
}

.progeny-info-content, .account-info-content {
    margin-bottom: 20px;
}

.info-item {
    margin-bottom: 15px;
}

.info-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #007bff;
    font-size: 16px;
}

.info-item .field-value {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

/* Inline display for read-only fields */
.info-item.inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item.inline label {
    display: inline-block;
    margin-bottom: 0;
}

.info-item.inline .field-value {
    display: inline-block;
    margin-bottom: 0;
}

.info-item input, .info-item select {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #333;
    color: white;
    font-size: 16px;
    display: block;
}

.info-item .readonly {
    background-color: #555;
    color: #ccc;
}

.account-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Mobile overlay for when sidebar is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Show mobile menu button on mobile */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Hide the sidebar's internal hamburger on mobile */
    .sidebar-header {
        display: none;
    }

    /* Add top padding to sidebar content on mobile to account for hidden header */
    .sidebar-content {
        padding-top: 80px;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 999;
        width: 80%;
        max-width: 300px;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar.collapsed {
        width: 80%;
        max-width: 300px;
    }

    .sidebar.collapsed .sidebar-content {
        display: block;
    }

    .main-content {
        width: 100%;
        padding: 30px 10px 10px 10px;
        height: calc(100vh - 80px);
    }

    .progeny-display {
        flex-direction: column;
        gap: 10px;
        height: 100%;
    }

    .progeny-image-container {
        flex: 0 0 300px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .progeny-image {
        width: 300px;
        height: 300px;
        border: 2px solid #ccc;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #333;
    }

    .chat-message {
        max-width: 85%; /* Only override what needs to change */
    }

    /* Ensure content area takes remaining space */
    .content-area {
        flex: 1;
        min-height: 0;
    }

    /* Ensure chat area fills remaining space properly */
    .chat-area {
        height: 100%;
        min-height: 300px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

}

@media (max-width: 480px) {
    .mobile-menu-btn {
        top: 10px;
        left: 10px;
        min-width: 45px;
        min-height: 45px;
        font-size: 18px;
        padding: 10px 12px;
    }

    .main-content {
        padding: 30px 10px 10px 10px;
        height: calc(100vh - 70px);
    }

    .progeny-image {
        width: 200px;
        height: 200px;
    }

    .progeny-buttons {
        width: 200px; /* Match smaller mobile image width */
    }

    .form-buttons {
        flex-direction: column;
    }

    .account-buttons {
        flex-direction: column;
    }

    .chat-message {
        max-width: 90%; /* Only override what needs to change */
    }

    /* Chat Message Styles */
    .chat-area {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding: 20px;
    }

    .chat-history {
    padding: 10px 0; /* Override padding for mobile */
    margin-bottom: 20px; /* Add margin for mobile */
    }

    .chat-message {
        margin-bottom: 15px;
        padding: 12px;
        border-radius: 12px;
        max-width: 85%;
        word-wrap: break-word;
        animation: fadeIn 0.3s ease-in;
    }

    .chat-message.user {
        background-color: #007bff;
        color: white;
        margin-left: auto;
        text-align: right;
        border-bottom-right-radius: 4px;
    }

    .chat-message.progeny {
        background-color: #2c2c2c;
        color: white;
        margin-right: auto;
        text-align: left;
        border-bottom-left-radius: 4px;
    }

    .message-content {
        margin-bottom: 5px;
        line-height: 1.5;
        font-size: 14px;
    }

    .message-time {
        font-size: 11px;
        opacity: 0.7;
        font-style: italic;
    }

    .chat-input {
        flex: 1;
        padding: 12px;
        border: 1px solid #444;
        border-radius: 25px;
        background-color: #333;
        color: white;
        font-size: 14px;
        outline: none;
    }

    .chat-input:focus {
        border-color: #007bff;
    }

    .btn-send {
        padding: 12px 20px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 25px;
        cursor: pointer;
        font-weight: 600;
        transition: background-color 0.3s;
    }

    .btn-send:hover {
        background-color: #0056b3;
    }

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