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

html {
    height: 100%;
    /* KEYBOARD FIX: Prevent viewport resize on mobile */
    height: 100vh;
    height: -webkit-fill-available;
}

body.loading {
    overflow: hidden;
}

body {
    background-image: url('background1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: 'Arial', sans-serif;
    color: #333;
    text-align: center;
    min-height: 100vh;
    /* KEYBOARD FIX: Use -webkit-fill-available for mobile */
    min-height: -webkit-fill-available;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* KEYBOARD FIX: Prevent layout shift when virtual keyboard appears */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
    }
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8e9ec;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-bar-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.loading-bar {
    width: 250px;
    height: 8px;
    background: rgba(255, 182, 193, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(255, 182, 193, 0.2);
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #ffb6c1, #ff69b4, #ff1493);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.loading-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-text {
    font-family: 'Brush Script MT', cursive;
    font-size: 14px;
    color: #ff69b4;
    opacity: 0.8;
    text-align: center;
    margin-top: 5px;
}

.main-screen {
    display: none;
    text-align: center;
    padding: 0;
    background-color: transparent;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

.corner-text {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 12px;
    color: #555;
    opacity: 0.7;
}

header {
    position: relative;
    animation: slideDown 0.75s ease forwards;
}

@keyframes slideDown {
    0% { transform: translateY(-100%) rotate(0deg); opacity: 0; }
    50% { opacity: 0.5; transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-48px) rotate(0deg); opacity: 1; }
}

.header-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.popup {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(236, 109, 194, 0.027);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#close-popup img {
    transition: transform 1s ease;
}

#close-popup img:hover {
    transform: scale(1.5);
}

button {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.paw-image {
    width: 100px;
    height: auto;
    animation: continuousZoom 4s ease-in-out infinite;
    transition: transform 0.2s;
}

.paw-image:hover {
    animation-play-state: paused;
    transform: scale(1.75);
}

.loading-gif {
    width: 80px;
    height: auto;
    margin-top: 10px;
}

@keyframes continuousZoom {
    0% { transform: scale(0.7); }
    50% { transform: scale(0.85); }
    100% { transform: scale(0.7); }
}

@keyframes zoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.icon-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: -50px;
    opacity: 0;
    transition: opacity 3s ease;
    visibility: hidden;
}

.social-icon {
    width: 50px;
    height: auto;
    margin: 6px;
    transition: transform 0.3s;
    animation: zoom 4s infinite;
}

.social-icon:hover {
    transform: scale(1.9);
    animation-play-state: paused;
}

.email-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
    color: rgb(7, 6, 6);
}

.email-popup button:hover, 
.confirmation-popup button:hover {
    background: #ffccd5 !important;
    transform: scale(1.05);
}

.email-popup .popup-content {
    background: #fdedf5;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.email-popup button {
    margin-top: 10px;
    padding: 5px 10px;
    cursor: pointer;
    background-color: #f7e9ee;
    border: none;
    border-radius: 5px;
}

.confirmation-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.confirmation-popup .popup-content {
    background: #fdedf5;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.confirmation-popup button {
    margin-top: 10px;
    padding: 5px 10px;
    cursor: pointer;
    background-color: #fdedf5;
    border: none;
    border-radius: 5px;
}

.email-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translateX(90%);
    background-color: #fdedf5fb;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 10px;
    min-width: 60px;
    text-align: center;
}

.dropdown:focus-within .dropdown-content {
    display: block;
}

.dropdown-content .social-icon {
    margin: 5px 0;
    display: block;
}

.drawing-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 330px;
    margin-left: auto;
    margin-right: auto;
}

.drawing-controls button {
    background: linear-gradient(to right, #fdeef5, #ffdbee);
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    color: #666;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
    font-size: 14px;
    flex-shrink: 0;
}

.drawing-controls button:hover {
    transform: scale(1.05);
    background: linear-gradient(to right, #ffdbee, #fdeef5);
}

#brush-size {
    background: linear-gradient(to right, #fdeef5, #ffdbee);
    border: 2px solid #ffb6c1;
    border-radius: 20px;
    padding: 6px 12px;
    height: 36px;
    width: 140px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

#brush-size:hover {
    transform: scale(1.02);
    background: linear-gradient(to right, #ffdbee, #fdeef5);
}

/* Webkit browsers (Chrome, Safari) */
#brush-size::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff69b4;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

#brush-size::-webkit-slider-thumb:hover,
#brush-size::-webkit-slider-thumb:active {
    transform: scale(1.2);
    background: #ff1493;
}

/* Firefox support */
#brush-size::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff69b4;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    -moz-appearance: none;
    appearance: none;
}

#brush-size::-moz-range-track {
    height: 4px;
    background: transparent;
    border-radius: 20px;
}

#color-picker {
    background: linear-gradient(to right, #fdeef5, #ffdbee);
    border: 2px solid #ffb6c1;
    border-radius: 50%;
    padding: 2px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
    flex-shrink: 0;
}

#color-picker:hover {
    transform: scale(1.05);
    background: linear-gradient(to right, #ffdbee, #fdeef5);
}

/* Webkit browsers (Chrome, Safari) */
#color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
    border-radius: 50%;
}

#color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

/* Firefox */
#color-picker::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

#send-drawing,
#send-question {
    width: 85%;
    background: linear-gradient(to right, #fcdee3, #ff8dc6) !important;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 36px;
    font-size: 14px;
    margin-top: 8px;
}

#send-drawing:hover,
#send-question:hover {
    background: linear-gradient(to right, #fcdee3, #ff8dc6) !important;
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .note-and-widget-container {
        flex-direction: column;
        align-items: center;
    }
}

.note-image.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
}

.drawing-widget.active {
    opacity: 1;
    pointer-events: auto;
}

.toggle-container {
    position: relative;
    min-height: 350px;
    margin: 0 auto;
    width: fit-content;
}

.content-area {
    position: relative;
    width: 100%;
}

/* Update note image positioning */
.note-image {
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: auto;
    max-height: 350px;
    margin: -2px 0;
}

/* Update drawing widget positioning */
.drawing-widget {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Ensure canvas has fixed dimensions */
#drawing-canvas {
    width: 330px;
    height: 230px;
    background-color: white;
    border-radius: 5px;
    cursor: crosshair;
    margin: 10px 0;
    touch-action: none;
}

.canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.button-group {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.email-button,
.next-button {
    background: linear-gradient(to right, #fdeef5, #ffdbee);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 40px;
    font-size: 14px;
}

.email-button img {
    width: 20px;
    height: auto;
    filter: brightness(0.9);
}

.email-button:hover,
.next-button:hover {
    transform: scale(1.05);
    background: linear-gradient(to right, #ffdbee, #fdeef5);
}

.email-button:active {
    box-shadow: 0 0 8px rgba(255, 182, 193, 0.8);
}

#ask-button {
    background: linear-gradient(to right, #fdeef5, #ffdbee);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ask-form-container {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    backdrop-filter: blur(5px);
    z-index: 10;
}

#ask-textarea {
    width: 100%;
    height: 100px;
    outline: none;
    border: 2px solid #ffb6c1 !important;
    border-radius: 8px;
    padding: 10px;
    resize: none;
    font-family: inherit;
    margin-bottom: 8px;
    transition: border-color 0.3s ease;
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#ask-textarea:focus {
    border-color: #ff69b4 !important;
    box-shadow: 0 0 0 2px rgba(255, 182, 193, 0.3);
    font-size: 16px !important;
}

.ask-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#char-count {
    font-size: 12px;
    color: #888;
}

/* Posts Popup Styles */
.posts-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.posts-popup .popup-content {
    background: #fdedf5;
    border-radius: 15px;
    max-width: 90%;
    width: 500px;
    max-height: 80vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content overflow affecting header */
}

.posts-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #fdedf5, #fff5f8);
    border-radius: 15px 15px 0 0;
    z-index: 10;
    border-bottom: 2px solid rgba(255, 182, 193, 0.4);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60px; /* Fixed height to prevent squishing */
    min-height: 60px; /* Ensure minimum height */
    max-height: 60px; /* Ensure maximum height */
    overflow: hidden;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.posts-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 1px 6px rgba(255, 105, 180, 0.15);
    backdrop-filter: blur(10px);
    margin-top: 6px;
}

.posts-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0; /* Allow content to shrink properly */
}

.tab-button {
    background: transparent;
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    color: #888;
    font-weight: 600;
    font-size: 13px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tab-button:hover {
    color: #ff69b4;
    transform: translateY(-1px);
}

.tab-button.active {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
    transform: translateY(-2px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.posts-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 0;
}

#questions-list {
    display: block;
    column-count: 2;
    column-gap: 15px;
    padding: 10px 0;
}

@media (max-width: 428px) {
    .posts-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 375px) {
    .posts-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    #questions-list {
        column-count: 2;
        column-gap: 12px;
    }
    
    .posts-header {
        padding: 10px 15px 8px 15px;
    }
    
    .tab-button {
        padding: 4px 12px;
        font-size: 12px;
    }
}

@media (max-width: 320px) {
    .posts-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    #questions-list {
        column-count: 2;
        column-gap: 10px;
    }
}

#questions-list .question-item {
    margin-bottom: 15px;
    width: 100%;
    height: fit-content;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
    animation: slideInQuestion 0.5s ease forwards;
    break-inside: avoid;
    display: block;
}

#drawings-list .post-item {
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
    animation: slideInDrawing 0.5s ease forwards;
}

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

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

#questions-list .question-item:nth-child(odd) {
    animation-delay: 0.1s;
}

#questions-list .question-item:nth-child(even) {
    animation-delay: 0.2s;
}

#drawings-list .post-item:nth-child(odd) {
    animation-delay: 0.1s;
}

#drawings-list .post-item:nth-child(even) {
    animation-delay: 0.2s;
}

.post-item {
    background: white;
    border-radius: 10px;
    padding: 10px;
    position: relative;
}

.post-item img {
    width: 100%;
    border-radius: 5px;
}

.post-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff6b6b;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 182, 193, 0.2);
}

.question-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.3);
    border-color: rgba(255, 182, 193, 0.4);
}

.question-text {
    font-style: italic;
    color: #555;
}

.answer-text {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ffb6c1;
    color: #ff69b4;
    font-weight: bold;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #ff69b4;
}

/* Posts popup close button specific styling */
.posts-header .close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 182, 193, 0.9);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
}

.posts-header .close-button:hover {
    background: rgba(255, 182, 193, 1);
    transform: scale(1.1);
}

.like-sticker {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.like-button {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.like-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.like-button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.like-icon {
    width: 22px;
    height: 22px;
    transition: all 0.3s ease;
    object-fit: contain;
}

.like-count-inline {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: bold;
    color: #ff69b4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: none; /* Hide the inline count */
}

/* Reaction Picker */
.reaction-picker {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(255, 105, 180, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 182, 193, 0.4);
    z-index: 10000;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    min-width: 140px;
    transform-origin: center bottom;
}

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

.reaction-options {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.reaction-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255, 255, 255, 0.9);
    position: relative;
    flex-shrink: 0;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.reaction-option:hover {
    transform: scale(1.2) translateY(-2px);
    background: rgba(255, 182, 193, 0.15);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

.reaction-option.current-reaction {
    background: rgba(255, 182, 193, 0.25);
    border: 2px solid #ff69b4;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(255, 105, 180, 0.4);
}

.reaction-option img {
    width: 20px;
    height: 20px;
}

.reaction-count {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.4);
    border: 1.5px solid white;
    transition: all 0.3s ease;
}

.post-item {
    position: relative;
    overflow: visible;
}

.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.contact-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.contact-form {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    padding-top: 40px; /* Some padding to accommodate profile photo coming out */
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: visible; /* Changed from overflow-y: auto to allow profile photo to come out */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 182, 193, 0.3);
    animation: slideInUp 0.4s ease;
    box-sizing: border-box;
    /* Ensure attachment preview stays within form */
    z-index: 1000;
}

.contact-profile-pic,
.profile-video {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 182, 193, 0.5);
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.3), 0 0 25px rgba(255, 182, 193, 0.4), 0 0 40px rgba(255, 182, 193, 0.2);
    top: -73px; /* Moved up by 7% from -68px to -73px */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: white;
    pointer-events: none; /* Prevent any user interaction */
}

/* Mobile video controls prevention */
.profile-video::-webkit-media-controls {
    display: none !important;
}

.profile-video::-webkit-media-controls-panel {
    display: none !important;
}

.profile-video::-webkit-media-controls-play-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-timeline {
    display: none !important;
}

.profile-video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.profile-video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.profile-video::-webkit-media-controls-mute-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-toggle-closed-captions-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.profile-video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-rewind-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-return-to-realtime-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-seek-back-button {
    display: none !important;
}

.profile-video::-webkit-media-controls-seek-forward-button {
    display: none !important;
}

/* Firefox video controls prevention */
.profile-video::-moz-media-controls {
    display: none !important;
}

.profile-video::-moz-media-controls-panel {
    display: none !important;
}

.profile-video::-moz-media-controls-play-button {
    display: none !important;
}

.profile-video::-moz-media-controls-timeline {
    display: none !important;
}

.profile-video::-moz-media-controls-current-time-display {
    display: none !important;
}

.profile-video::-moz-media-controls-time-remaining-display {
    display: none !important;
}

.profile-video::-moz-media-controls-mute-button {
    display: none !important;
}

.profile-video::-moz-media-controls-volume-slider {
    display: none !important;
}

.profile-video::-moz-media-controls-fullscreen-button {
    display: none !important;
}

/* Prevent video from being focusable */
.profile-video:focus {
    outline: none !important;
}

/* Prevent any hover effects on video */
.profile-video:hover {
    cursor: default !important;
}

.contact-header {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 10px; /* Minimal height */
    padding-top: 10px; /* Minimal padding since profile photo is now outside */
}

.contact-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 182, 193, 0.9);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
}

.contact-close-btn:hover {
    background: rgba(255, 182, 193, 1);
    transform: scale(1.1);
}

.contact-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    margin-top: 0; /* No extra space above title */
    text-align: center;
}

.contact-form-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.contact-form-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Name and phone row container - applies to all screen sizes */
.name-phone-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.name-phone-row .form-group {
    flex: 1;
    width: 50%;
}

.form-group {
    position: relative;
    overflow: visible;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: 10px;
    font-size: 16px; /* Prevent mobile zoom */
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 182, 193, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.1);
}

.form-group textarea {
    resize: none;
    min-height: 80px;
    font-family: inherit;
    overflow-y: auto;
    padding-right: 60px;
    position: relative;
    overflow: visible;
}

/* Notes and attachment row - horizontal layout */
.notes-attachment-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.notes-group {
    flex: 1;
    width: 100%;
}

.attachment-button-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px; /* Align with textarea */
}

.attachment-button {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
    display: block;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* iOS-specific improvements */
    -webkit-touch-callout: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    /* Enhanced iOS compatibility */
    position: relative;
    z-index: 1000;
    background: transparent;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Force hardware acceleration */
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

.attachment-button:hover {
    opacity: 1;
}

.attachment-button:active {
    opacity: 0.8;
}

.social-group {
    display: flex;
    gap: 10px;
    align-items: flex-start; /* Changed from center to align items to top */
}

.social-selector {
    position: relative;
    flex-shrink: 0;
}

.contact-form .social-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 182, 193, 0.3);
}

.contact-form .social-icon:hover {
    transform: scale(1.1);
    border-color: rgba(255, 182, 193, 0.8);
}

.social-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 182, 193, 0.3);
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    width: fit-content;
    min-width: 80px;
}

.social-dropdown.active {
    display: flex;
    animation: slideInDown 0.3s ease;
}

.social-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.social-option:hover {
    transform: scale(1.1);
    border-color: rgba(255, 182, 193, 0.5);
}

.social-option.active {
    border-color: rgba(255, 182, 193, 0.8);
    background: rgba(255, 182, 193, 0.1);
}

/* Removed old attachment-icons - replaced with attachment-section */

/* Removed old attachment-icon - replaced with attachment-button */

/* Attachment preview area */
.attachment-preview {
    position: relative;
    width: 100%;
    margin-top: 8px;
    display: none; /* Hidden by default */
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    transition: all 0.3s ease;
    z-index: 1;
    background: transparent;
    /* Ensure it stays within the form */
    overflow: visible;
}

.attachment-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 182, 193, 0.3);
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001; /* Ensure it appears above the form */
}

.attachment-preview-item:hover {
    border-color: rgba(255, 182, 193, 0.8);
    transform: scale(1.05);
}

.attachment-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview-item .file-icon {
    width: 30px;
    height: 30px;
    opacity: 0.7;
}

.attachment-preview-item .remove-attachment {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #ff6b6b;
    color: white;
    border: 1.5px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 10;
    line-height: 1;
}

.attachment-preview-item .remove-attachment:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.connect-btn {
    background: linear-gradient(135deg, #ffb6c1, #ff69b4, #ff1493, #ff69b4, #ffb6c1);
    background-size: 300% 100%;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
    animation: gradientFlow 3s ease-in-out infinite;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

.connect-btn:active {
    transform: translateY(0);
}

.contact-disclaimer {
    font-size: 11px;
    color: #666;
    text-align: center;
    margin-top: 15px;
    line-height: 1.4;
}

.clickable-link {
    color: rgba(255, 182, 193, 0.8);
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-link:hover {
    color: rgba(255, 182, 193, 1);
    text-decoration: underline;
}

.terms-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin-top: 15px;
    border: 1px solid rgba(255, 182, 193, 0.3);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.1);
}

.terms-content p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #333;
    font-size: 14px;
    text-align: justify;
}

.terms-content p:last-child {
    margin-bottom: 0;
}

.terms-content strong {
    color: #ff69b4;
    font-weight: 600;
}

.terms-content em {
    color: #888;
    font-style: italic;
}

/* Terms & Privacy Modal Styles */
.terms-privacy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.terms-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.terms-form {
    position: relative;
    background: linear-gradient(135deg, #fdedf5, #fff5f8);
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(255, 105, 180, 0.3);
    border: 2px solid rgba(255, 182, 193, 0.4);
    backdrop-filter: blur(15px);
    animation: slideInUp 0.3s ease;
}

.terms-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.terms-close-btn {
    background: rgba(255, 182, 193, 0.9);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.terms-close-btn:hover {
    background: rgba(255, 182, 193, 1);
    transform: scale(1.1);
}

.terms-title {
    text-align: center;
    color: #ff69b4;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 0;
}

/* Desktop override for very large screens - stack fields vertically */
@media (min-width: 1200px) {
    .name-phone-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .name-phone-row .form-group {
        width: 100%;
    }
}

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

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

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

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

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

/* Mobile responsiveness - consolidated and optimized */
@media (max-width: 1024px) {
    .contact-form {
        padding: 20px;
        padding-top: 20px;
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .contact-profile-pic,
    .profile-video {
        width: 80px;
        height: 80px;
        top: -55px;
        background: white;
    }
    
    .contact-title {
        font-size: 16px;
        margin-top: 0;
    }
    
    .social-group {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
    }
    
    .social-selector {
        align-self: flex-start;
        flex-shrink: 0;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .attachment-button {
        width: 20px;
        height: 20px;
    }
    
    .notes-attachment-row {
        gap: 8px;
    }
    
    .attachment-button-container {
        margin-top: 10px;
    }
    
    .contact-form-content {
        gap: 12px;
    }
    
    .contact-form-content .form-group {
        width: 100%;
    }
    
    .name-phone-row {
        flex-direction: row !important;
    }
    
    .name-phone-row .form-group {
        display: block !important;
        flex: 1 !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .attachment-button {
        width: 18px;
        height: 18px;
    }
    
    .notes-attachment-row {
        gap: 6px;
    }
    
    .attachment-button-container {
        margin-top: 8px;
    }
}
