/* Add this at the top of your styles.css file */
:root {
    --phone-width: 510px; 
    --phone-height: 990px; 
}

/* Define the font */
@font-face {
    font-family: 'SF Pro Display';
    src: url('fonts/SF-Pro-Display-Regular.woff2') format('woff2'),
         url('fonts/SF-Pro-Display-Regular.woff') format('woff');
    font-weight: 400; /* Regular weight */
    font-style: normal;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('fonts/SF-Pro-Display-Medium.woff2') format('woff2'),
         url('fonts/SF-Pro-Display-Medium.woff') format('woff');
    font-weight: 500; /* Medium weight */
    font-style: normal;
}

/* Apply the font to the body */
body {
    font-family: 'SF Pro Display', sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden; /* Prevent scrolling */
}

.phone-screen {
    width: 510px; /* Original width of the phone screen */
    height: 990px; /* Original height of the phone screen */
    border-radius: 0px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    backdrop-filter: blur(20px);
    transform-origin: top left; /* Scale from the top-left corner */
}

.chat-header {
    color: #fff;
    padding: 55px;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space between settings button and title */
    z-index: 800;
    position: absolute;
    top: 0;
    left: 0;
    width: 95%;
    backdrop-filter: blur(50px); /* Increased blur for transparency */
    -webkit-backdrop-filter: blur(50px); /* Safari support */
    background-color: rgba(54, 65, 70, 0.3); /* More transparent background */
}

.chat-title-container {
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center horizontally */
    justify-content: center; /* Center vertically */
    position: absolute;
    left: 43%;
    transform: translateX(-50%);
    gap: 0px; /* Space between icon and title */
}

#image-select-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 8px; /* Space between icon and title */
}

#header-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%; /* Circular icon */
    object-fit: cover; /* Ensure the image fits well */
}

#chat-title {
    font-size: 15px;
    font-weight: 500;
    color: #f0f0f0;
    padding-right: 5px;
    padding-top: 3px;
}

#settings-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    left: 16px; /* Positioned top-left */
    fill: #0a84ff!important;
}

.back-icon {
    width: 14px;
    height: 24px;
    fill: #0a84ff!important;
}
.nothing-icon {
    width: 46px;
    height: 34px;
    right: 0;
    /* fill: #0a84ff!important; */
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    background-color: rgb(0, 0, 0);
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    padding-top: 210px; /* Add padding to allow overscroll */
    margin-top: -100px; /* Negative margin to compensate for padding */
    scroll-behavior: smooth;
}

.message-container {
    display: flex;
    align-items: flex-end;
    margin-left: 16px;
    margin-right: 16px; 
    border-radius: 20px;
    max-width: 75%;
    position: relative;
    background-color: inherit; 
    
}

.message {
    overflow: hidden;
}



.message img {
    max-width: 100%; /* Ensure the image does not exceed the width of the message container */
    max-height: 300px; /* Set a maximum height for the image */
    border-radius: 20px; /* Optional: Add rounded corners to the image */
    object-fit: cover; /* Ensure the image maintains its aspect ratio */
    display: block; /* Remove any extra space below the image */
    margin: 0 auto; /* Center the image horizontally */
    -webkit-user-drag: none; /* Standard syntax */
    pointer-events: none; /* Optional: Prevents the image from being interactive */
    scale: 115% ;
}



.non-consecutive-message {
    margin-bottom: 12px;
}

.consecutive-message {
    margin-bottom: 2px;
}

.message-container.person1 {
    align-self: flex-start;
    background-color: #2c2c2e; /* Background color for person1 */
}

.message-container.person2 {
    align-self: flex-end;
    background-color: #0a84ff; /* Background color for person2 */
}

.message {
    padding: 10px 15px;
    border-radius: 20px;
    word-wrap: break-word;
    font-size: 21px;
    letter-spacing: 0.3px;
    line-height: 1.2;
    cursor: pointer;
    position: relative;
    background-color: inherit; /* Inherit background color from container */
    color: white
}

.message-tail {
    width: 16px; /* Adjust the size as needed */
    height: 16px; /* Adjust the size as needed */
    position: absolute;
    bottom: 0;
    z-index: 1; /* Ensure the tail is behind the message */
}

.message-container.person1 .message-tail {
    left: -6px; /* Adjust the position as needed */
    transform: scaleX(-1); /* Flip the tail for person2 */
}

.message-container.person2 .message-tail {
    right: -6px; /* Adjust the position as needed */
    transform: scaleX(1); /* Flip the tail for person2 */
}


.chat-input {
    display: flex;
    padding: 2px;
    background-color: #000000;
    position: sticky;
    bottom: 8px;
}

.chat-input input {
    flex: 1;
    padding: 0px 15px;
    border: 1px solid #444;
    border-radius: 30px;
    outline: none;
    font-size: 22px;
    margin-left: 22px;
    margin-right: 15px;
    background-color: #000000;
    color: #fff;
}

.chat-input input::placeholder {
    color: #77777c;
}

.chat-input button {
    padding: 0px;
    background-color: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
}

.settings-menu,
.live-chat-settings-screen {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2c2c2e;
    padding: 20px;
    width: 250px;
    border: 5px solid #1b1b1b;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    color: #fff;
    display: flex;
    flex-direction: column; /* Arrange children (buttons) in a column */
    align-items: center; /* Center buttons horizontally */
}

.settings-menu input,
.media-menu input,
.live-chat-settings-screen input {
    display: block;
    margin-bottom: 10px;
    padding: 8px;
    width: 100%;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 16px;
    background-color: #3a3a3c;
    color: #fff;
}

.settings-menu button,
.secondary-screen,
.media-menu button {
    padding: 8px;
    background-color: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin: 4px 0; /* Add vertical spacing between buttons */
    width: 100%; /* Make buttons take full width of the menu */
    text-align: center; /* Center text inside buttons */
}

#text-file-input {
    width: 230px;
    height: 20px;
    background-color: #252525;
    color: #fff;
}



.settings-menu button:hover,
.media-menu button:hover,
.live-chat-settings-screen button:hover {
    background-color: #607bad;
}

#system-prompt {
    width: 238px;
    height: 220px;
    background-color: #252525;
    color: #fff;
}
#server-url {
    width: 230px;
    height: 20px;
    background-color: #252525;
    color: #fff;
}

#live-chat-settings-screen {
    background-color: #3a3a3c;
    position: relative;
    margin: 0;
    padding:0%;
}



#back-to-main-settings-button {
    padding: 8px;
    background-color: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 0; /* Add vertical spacing above the button */
    width: 100%; /* Make buttons take full width of the menu */
    text-align: center; /* Center text inside buttons */
}

#back-to-main-settings-button:hover {
    background-color: #607bad;
}

/* Hide the secondary screen by default */
.secondary-screen {
    display: none;
}

/* Show the secondary screen when active */
.secondary-screen.active {
    display: block;
}



#delete-chat-button {
    background-color: #ff3b30; /* Red background color */
    color: #fff; /* White text color */
    border: none; /* Remove default border */
    border-radius: 8px; /* Rounded corners */
    padding: 8px; /* Padding inside the button */
    font-size: 16px; /* Font size */
    cursor: pointer; /* Pointer cursor on hover */
    width: 100%; /* Full width of the container */
    margin: 4px 0; /* Vertical spacing between buttons */
    text-align: center; /* Center text inside the button */
}
#connect-button {
    background-color: #05a500; /* Red background color */
    color: #fff; /* White text color */
    border: none; /* Remove default border */
    border-radius: 8px; /* Rounded corners */
    padding: 8px; /* Padding inside the button */
    font-size: 16px; /* Font size */
    cursor: pointer; /* Pointer cursor on hover */
    width: 100%; /* Full width of the container */
    margin: 4px 0; /* Vertical spacing between buttons */
    text-align: center; /* Center text inside the button */
}

#delete-chat-button:hover {
    background-color: #ff5e52; /* Lighter red on hover */
}

.media-menu img {
    max-width: 100px;
    margin: 5px;
    cursor: pointer;
}

/* Drag-and-Drop Visual Feedback */
.phone-screen.drag-over {
    border: 2px #007aff; /* Add a dashed border when dragging over */
    background-color: rgba(0, 122, 255, 0.1); /* Add a light background color */
}

/* General button styling (optional, for consistency) */
#send-button-person1,
#send-button-person2 {
    border: none; /* Remove default border */
    background-color: transparent; /* Make background transparent */
    cursor: pointer; /* Change cursor to pointer on hover */
    padding: 0px; /* Add padding for better clickability */
    border-radius: 50%; /* Make buttons circular */
    display: flex; /* Center the icon inside the button */
    align-items: center;
    margin-left: 15px;
    justify-content: center;
    transition: background-color 0.3s ease; /* Smooth hover effect */
}

/* Hover effects for both buttons */
#send-button-person1:hover,
#send-button-person2:hover {
    background-color: rgba(0, 0, 0, 0.1); /* Light gray background on hover */
}

/* Specific styling for #send-button-person1 (App Store button) */
#send-button-person1 {
    background-color: #30303000; /* Blue background */
}
#send-button-person1:hover {
    transform: scale(1.1);
}

#send-button-person1 img {
    width: 55px; /* Set icon size */
    height: 55px;
    filter: brightness(0.5) invert(1); /* Make the icon white */
}

/* Specific styling for #send-button-person2 (Camera button) */
#send-button-person2 {
    background-color: #05d15300; /* Green background */
}
#send-button-person2:hover {
    transform: scale(1.1);
}

#send-button-person2 img {
    width: 40px; /* Set icon size */
    height: 40px;
    padding-left: 10px;
    filter: brightness(0.5) invert(1); /* Make the icon white */
}

/* Floating mic button styling */
#floating-mic-button {
    position: fixed; /* Fixed position to keep it in place */
    bottom: 8px; /* Distance from the bottom */
    right: 20px; /* Distance from the right */
    width: 45px; /* Button size */
    height: 56px;
    background-color: #00000000; 
    border: none; /* Remove default border */
    border-radius: 50%; /* Make it circular */
    cursor: pointer; /* Pointer cursor on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Add a shadow */
    display: flex; /* Center the icon */
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease; /* Smooth transitions */
}

/* Icon inside the floating mic button */
#floating-mic-button img {
    width: 30px; /* Icon size */
    height: 30px;
    filter: brightness(0.1) invert(1); /* Make the icon white */
}

.message {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.message {
    will-change: transform, opacity;
}

#chat-messages::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge, and Firefox */
#chat-messages {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}


.media-menu,
.context-menu {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2c2c2e;
    padding: 20px;
    width: 250px;
    border: 10px solid #1b1b1b;
    border-radius: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    color: #fff;
    
}

.context-menu {
    display: flex;
    flex-direction: column;
    margin-bottom: 0px;
    padding: 16px; /* Adjusted padding for better spacing */
    width: 150px; /* Let the width adjust to content */
    border: 10px solid #2b2b2b;
    border-radius: 30px;
    font-size: 16px;
    background-color: #3a3a3c;
    color: #fff;
    align-items: center; /* Center buttons horizontally */
    justify-content: center; /* Center buttons vertically */
}

.context-menu button {
    padding: 8px;
    background-color: #0a84ff;
    color: #fff;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    margin: 4px 0; /* Add vertical spacing between buttons */
    width: 100%; 
    text-align: center; /* Center text inside buttons */
}

/* CSS for the loading GIF */
.loading-gif {
    width: 50px; /* Adjust the size of the GIF as needed */
    height: 40px; /* Adjust the size of the GIF as needed */
    display: block; /* Ensure the GIF is treated as a block element */
    margin: 0 auto; /* Center the GIF horizontally within the container */
    margin-bottom: 2px;
    border-radius: 20px; /* Optional: Add rounded corners for a softer look */
    object-fit: cover; /* Ensure the GIF scales properly */
    opacity: 1; /* Optional: Slightly transparent for a subtle effect */
}

/* Optional: Add animation to the container for a smoother transition */
.message-container.person1 .loading-gif {
    animation: fadeIn 0.5s ease-in-out; /* Fade-in effect for the GIF */
}



@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0px); /* Slight upward movement */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-menu,
.live-chat-settings-screen,
.context-menu {
    display: none; /* Hide the elements by default */
}
