/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    cursor: url('cursor.png'), auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #fdf2f8;
    height: 100vh;
    overflow: hidden;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8bbdd 0%, #ec4899 50%, #be185d 100%);
}

.auth-container > div {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.3);
    width: 90%;
    max-width: 400px;
    border: 2px solid rgba(236, 72, 153, 0.1);
}

.auth-container h2 {
    margin-bottom: 1.5rem;
    color: #be185d;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #be185d;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #f9a8d4;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #fdf2f8;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
    background-color: white;
}

.form-group small {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8bbdd 0%, #ec4899 50%, #be185d 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.btn-edit-name {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-right: 1rem;
}

.btn-edit-name:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.switch-auth {
    text-align: center;
    margin-top: 1rem;
    color: #be185d;
}

.switch-auth a {
    color: #ec4899;
    text-decoration: none;
    font-weight: 600;
}

.switch-auth a:hover {
    text-decoration: underline;
    color: #be185d;
}

.error-message {
    color: #dc2626;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.success-message {
    color: #ec4899;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Home Container */
.home-container {
    display: none;
    width: 100%;
    height: 100vh;
    background: linear-gradient(45deg, #fdf2f8 0%, #fce7f3 50%, #fdf2f8 100%);
    flex-direction: column;
}

.home-header {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
}

.home-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Profile Update Section */
.profile-update-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1);
    border: 2px solid rgba(236, 72, 153, 0.05);
    animation: slideInDown 0.5s ease-out;
}

.profile-update-section h3 {
    color: #be185d;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.form-actions .btn {
    width: auto;
    flex: 1;
}

/* Post Creation Section */
.post-creation-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1);
    border: 2px solid rgba(236, 72, 153, 0.05);
}

.post-creation-section h3 {
    color: #be185d;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

#postContent {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
}

.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

.post-media-section {
    margin: 1rem 0;
}

.media-upload-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.media-upload-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.media-preview {
    margin-top: 1rem;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #f9a8d4;
}

.media-preview-content img,
.media-preview-content video {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.remove-media {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.remove-media:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* News Feed Section */
.news-feed-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1);
    border: 2px solid rgba(236, 72, 153, 0.05);
}

.news-feed-section h3 {
    color: #be185d;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.news-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-item {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-radius: 15px;
    padding: 1.5rem;
    border: 2px solid rgba(236, 72, 153, 0.1);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.2);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.post-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.post-user-info {
    flex: 1;
}

.post-user-name {
    font-weight: bold;
    color: #be185d;
    font-size: 1rem;
}

.post-timestamp {
    color: rgba(190, 24, 93, 0.7);
    font-size: 0.85rem;
}

.post-content {
    color: #7c2d92;
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.post-media {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.post-media img,
.post-media video {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.post-media img {
    background: transparent;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(236, 72, 153, 0.1);
}

.post-action {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    color: #ec4899;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.post-action:hover {
    background: rgba(236, 72, 153, 0.1);
}

.post-action.active {
    background: rgba(236, 72, 153, 0.2);
    color: #be185d;
}

.post-edit-btn {
    margin-left: auto;
    color: #6b7280 !important;
    font-size: 0.8rem !important;
}

.post-edit-btn:hover {
    background: rgba(107, 114, 128, 0.1) !important;
    color: #4b5563 !important;
}

/* Post Edit Modal */
.post-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.post-edit-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.3);
}

.post-edit-content h3 {
    color: #be185d;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.post-edit-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.post-edit-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.post-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-edit-form textarea {
    min-height: 120px;
    resize: vertical;
}

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

.post-edit-actions .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

.current-media-preview {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #f3f4f6;
    position: relative;
}

.current-media-preview img,
.current-media-preview video {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    background: #f9fafb;
}

.remove-current-media {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.remove-current-media:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* Post edited indicator */
.post-edited {
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.post-edit-history {
    color: #9ca3af;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.post-edit-history:hover {
    color: #6b7280;
}

/* Post Reactions */
.post-reactions {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.post-reaction {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 15px;
    padding: 4px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    min-height: 28px;
}

.post-reaction:hover {
    background: rgba(236, 72, 153, 0.2);
    transform: scale(1.05);
}

.post-reaction.active {
    background: #fce7f3;
    border-color: #ec4899;
    box-shadow: 0 2px 4px rgba(236, 72, 153, 0.2);
}

.post-reaction-count {
    font-size: 0.8rem;
    color: #be185d;
    font-weight: 600;
}

.post-reaction-emoji {
    font-size: 1rem;
}

/* Reaction Picker for Posts */
.post-reaction-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
    padding: 0.5rem;
    display: none;
    gap: 0.5rem;
    z-index: 1000;
    border: 1px solid rgba(236, 72, 153, 0.1);
    animation: fadeInUp 0.3s ease;
}

.post-reaction-picker.active {
    display: flex;
}

.post-reaction-picker .reaction-option {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-reaction-picker .reaction-option:hover {
    background: #fce7f3;
    transform: scale(1.2);
}

.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pagination-controls .btn {
    width: auto;
    padding: 0.75rem 1.5rem;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1);
    border: 2px solid rgba(236, 72, 153, 0.05);
}

.search-section h3 {
    color: #be185d;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.search-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#userSearchInput {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #f9a8d4;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background-color: #fdf2f8;
}

#userSearchInput:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
    background-color: white;
}

#clearSearch {
    width: auto;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

#clearSearch:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Tarot Section */
.tarot-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1);
    border: 2px solid rgba(236, 72, 153, 0.05);
}

.tarot-section h3 {
    color: #be185d;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
}

.tarot-info {
    text-align: center;
    margin-bottom: 1rem;
    color: #7c2d92;
}

.tarot-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.tarot-info small {
    opacity: 0.8;
    font-style: italic;
}

.tarot-deck {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    max-width: 800px;
    margin: 0 auto 1rem;
    padding: 1rem;
    background: linear-gradient(45deg, #fdf2f8, #fce7f3);
    border-radius: 15px;
}

.tarot-card {
    width: 60px;
    height: 100px;
    background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fbbf24;
    text-align: center;
    font-weight: bold;
    overflow: hidden;
}

.tarot-card .card-symbol {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.tarot-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.4);
    z-index: 10;
}

.tarot-card:hover .card-symbol {
    transform: scale(1.2);
}

.tarot-card.flipped {
    background: linear-gradient(135deg, #f8bbdd 0%, #ec4899 50%, #be185d 100%);
    color: white;
    animation: flip 0.6s ease-in-out, glow 2s ease-in-out;
    position: relative;
}

.tarot-card.flipped .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2px;
}

.tarot-card.flipped .card-name-short {
    font-size: 0.5rem;
    font-weight: bold;
    margin-bottom: 2px;
    line-height: 1;
}

.tarot-card.flipped .card-type {
    font-size: 0.4rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tarot-card.flipped::after {
    content: '✨';
    position: absolute;
    top: -8px;
    right: -8px;
    animation: sparkle 1s ease-in-out infinite;
    font-size: 10px;
}

.tarot-result {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-radius: 15px;
    border: 2px solid rgba(236, 72, 153, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.tarot-card-result {
    margin-bottom: 1.5rem;
}

.tarot-card-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #be185d;
    margin-bottom: 0.5rem;
}

.tarot-card-meaning {
    color: #7c2d92;
    line-height: 1.6;
    font-size: 1rem;
}

.tarot-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tarot-admin {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.tarot-admin h4 {
    color: #dc2626;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-admin {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    font-size: 0.9rem;
}

.btn-admin:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

/* Users Section */
.users-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.1);
    border: 2px solid rgba(236, 72, 153, 0.05);
}

.users-section h3 {
    color: #be185d;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.user-card {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-radius: 15px;
    padding: 1rem;
    border: 2px solid rgba(236, 72, 153, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: slideInLeft 0.5s ease-out;
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.2);
    border-color: #ec4899;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.user-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-card-info {
    flex: 1;
}

.user-card-name {
    font-weight: bold;
    color: #be185d;
    font-size: 1.1rem;
}

.user-card-username {
    color: rgba(190, 24, 93, 0.7);
    font-size: 0.9rem;
}

.user-card-bio {
    color: rgba(124, 45, 146, 0.8);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.loading {
    text-align: center;
    color: #be185d;
    font-style: italic;
    padding: 2rem;
}

/* Chat Container Updates */
.chat-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.chat-header {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-partner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: linear-gradient(45deg, #fdf2f8 0%, #fce7f3 50%, #fdf2f8 100%);
    background-image: radial-gradient(circle at 25% 25%, rgba(236, 72, 153, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    position: relative;
}

.message.own {
    justify-content: flex-end;
}

.message-wrapper {
    max-width: 65%;
    position: relative;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.15);
}

.message:not(.own) .message-content {
    background: white;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(236, 72, 153, 0.1);
}

.message.own .message-content {
    background: linear-gradient(135deg, #f8bbdd 0%, #ec4899 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Message Actions */
.message-actions {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 6px;
    padding: 4px 6px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.2);
    z-index: 10;
}

.message:hover .message-actions {
    display: flex;
}

.message-action {
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
    font-size: 1.1rem;
    color: #ec4899;
}

.message-action:hover {
    background: #fce7f3;
}

/* Message Header */
.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sender {
    font-weight: 600;
    font-size: 0.85rem;
    color: #be185d;
}

.timestamp {
    font-size: 0.75rem;
    color: rgba(190, 24, 93, 0.6);
}

/* Reply Info */
.reply-info {
    background: rgba(236, 72, 153, 0.1);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    border-left: 3px solid #ec4899;
}

.reply-info .reply-to {
    font-weight: 600;
    color: #be185d;
    font-size: 0.8rem;
}

.reply-info .reply-text {
    color: rgba(190, 24, 93, 0.7);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Post Reference in Messages */
.post-reference {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border: 2px solid rgba(236, 72, 153, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.post-ref-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.post-ref-content {
    flex: 1;
    min-width: 0;
}

.post-ref-label {
    font-weight: 600;
    color: #be185d;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.post-ref-text {
    color: #7c2d92;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-ref-author {
    color: rgba(190, 24, 93, 0.8);
    font-size: 0.8rem;
    font-style: italic;
}

/* Media in messages */
.message img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-top: 5px;
    cursor: pointer;
}

.message audio {
    margin-top: 5px;
    width: 250px;
}

/* Reactions */
.reactions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.reaction {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 15px;
    padding: 2px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.reaction:hover {
    background: rgba(236, 72, 153, 0.2);
}

.reaction.active {
    background: #fce7f3;
    border-color: #ec4899;
}

.reaction-count {
    font-size: 0.8rem;
    color: #be185d;
}

/* Input Container */
.input-container {
    background: #fdf2f8;
    padding: 0.5rem 1rem;
    position: relative;
    border-top: 1px solid rgba(236, 72, 153, 0.1);
    min-height: 60px;
    z-index: 3;
}

/* Post Context Indicator */
.post-context-indicator {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInDown 0.3s ease;
}

.post-context-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    overflow: hidden;
}

.post-context-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.post-context-text {
    flex: 1;
    min-width: 0;
}

.post-context-label {
    font-weight: 600;
    color: #be185d;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.post-context-preview {
    color: #7c2d92;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-context-close {
    cursor: pointer;
    color: #ec4899;
    font-size: 1.2rem;
    padding: 0.25rem;
    line-height: 1;
    background: none;
    border: none;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.post-context-close:hover {
    background: rgba(236, 72, 153, 0.1);
    color: #be185d;
}

/* Reply Preview */
.reply-preview {
    background: white;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #ec4899;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.15);
}

.reply-preview-content {
    flex: 1;
    overflow: hidden;
}

.reply-preview-to {
    font-weight: 600;
    color: #be185d;
    font-size: 0.85rem;
}

.reply-preview-text {
    color: rgba(190, 24, 93, 0.7);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-cancel {
    cursor: pointer;
    color: #ec4899;
    font-size: 1.5rem;
    padding: 0 8px;
    line-height: 1;
}

.reply-cancel:hover {
    color: #be185d;
}

/* Input Wrapper */
.input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.input-actions img{
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.input-action {
    cursor: pointer;
    padding: 0.5rem;
    color: #ec4899;
    font-size: 1.3rem;
    border-radius: 50%;
    transition: background 0.2s;
    position: relative;
}

.input-action:hover {
    background: rgba(236, 72, 153, 0.1);
}

#messageInput {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #f9a8d4;
    border-radius: 30px;
    background: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#messageInput:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

/* Nút gửi đi */
.send-btn {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.send-btn:hover {
    background: linear-gradient(135deg, #be185d 0%, #9d174d 100%);
    transform: scale(1.05);
}

/* Recording Indicator */
.recording-indicator {
    position: absolute;
    bottom: 100%;
    left: 1rem;
    right: 1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.recording-indicator.active {
    display: flex;
}

.recording-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 -4px 20px rgba(236, 72, 153, 0.3);
    padding: 0.5rem;
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    max-width: 320px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(236, 72, 153, 0.1);
}

.emoji-picker.active {
    display: grid;
}

.emoji {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.3rem;
    transition: background 0.2s;
}

.emoji:hover {
    background: #fce7f3;
}

/* GIF Picker */
.gif-picker {
    position: absolute;
    bottom: 100%;
    right: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 -4px 20px rgba(236, 72, 153, 0.3);
    display: none;
    flex-direction: column;
    width: 320px;
    height: 380px;
    border: 1px solid rgba(236, 72, 153, 0.1);
}

.gif-picker.active {
    display: flex;
}

.gif-search {
    padding: 0.75rem;
    border-bottom: 1px solid #fce7f3;
}

.gif-search input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 2px solid #f9a8d4;
    border-radius: 20px;
    outline: none;
    transition: border-color 0.3s;
}

.gif-search input:focus {
    border-color: #ec4899;
}

.gif-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.gif-item {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
}

.gif-item:hover {
    transform: scale(1.05);
    border-color: #ec4899;
}

.gif-item img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* Chat Images */
.chat-images {
    position: absolute;
    bottom: 68px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

/* Hide file input */
input[type="file"] {
    display: none;
}

/* Animations */
@keyframes flip {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(90deg) scale(1.1); }
    100% { transform: rotateY(0deg) scale(1); }
}

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

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(236, 72, 153, 0.5); }
    50% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.8), 0 0 30px rgba(236, 72, 153, 0.6); }
}

/* Scrollbar */
.messages::-webkit-scrollbar,
.gif-results::-webkit-scrollbar,
.emoji-picker::-webkit-scrollbar,
.home-content::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track,
.gif-results::-webkit-scrollbar-track,
.emoji-picker::-webkit-scrollbar-track,
.home-content::-webkit-scrollbar-track {
    background: rgba(236, 72, 153, 0.1);
}

.messages::-webkit-scrollbar-thumb,
.gif-results::-webkit-scrollbar-thumb,
.emoji-picker::-webkit-scrollbar-thumb,
.home-content::-webkit-scrollbar-thumb {
    background: rgba(236, 72, 153, 0.4);
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover,
.gif-results::-webkit-scrollbar-thumb:hover,
.emoji-picker::-webkit-scrollbar-thumb:hover,
.home-content::-webkit-scrollbar-thumb:hover {
    background: rgba(236, 72, 153, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .message-wrapper {
        max-width: 80%;
    }
    
    .gif-picker {
        width: 280px;
        height: 320px;
    }
    
    .emoji-picker {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .home-content {
        padding: 1rem;
    }
    
    .tarot-deck {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
        gap: 4px;
        padding: 0.5rem;
        max-height: 300px;
    }
    
    .tarot-card {
        width: 40px;
        height: 65px;
        font-size: 0.5rem;
    }
    
    .tarot-card .card-symbol {
        font-size: 1rem;
    }
    
    .tarot-card.flipped .card-name-short {
        font-size: 0.4rem;
    }
    
    .tarot-card.flipped .card-type {
        font-size: 0.35rem;
    }
    
    .tarot-info p {
        font-size: 0.8rem;
    }
    
    .tarot-result {
        padding: 1rem;
    }
    
    .tarot-card-name {
        font-size: 1.2rem;
    }
    
    .tarot-card-meaning {
        font-size: 0.9rem;
    }
    
    .tarot-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .users-list {
        grid-template-columns: 1fr;
    }
    
    .chat-header-left {
        gap: 0.5rem;
    }
    
    .back-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .user-card-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .tarot-section, .users-section, .post-creation-section, .news-feed-section, .search-section {
        padding: 1rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-edit-name {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .auth-container > div {
        width: 95%;
        padding: 1.5rem;
    }
    
    .home-header {
        padding: 0.8rem;
    }
    
    .chat-header {
        padding: 0.8rem;
        flex-wrap: wrap;
    }
    
    .input-wrapper {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .input-actions {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    #messageInput {
        order: 1;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .send-btn {
        order: 3;
        width: 100%;
        border-radius: 12px;
        height: 40px;
    }
    
    .tarot-deck {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        padding: 0.5rem;
    }
    
    .tarot-card {
        width: 45px;
        height: 70px;
        font-size: 0.5rem;
    }
    
    .tarot-card-name {
        font-size: 1.2rem;
    }
    
    .tarot-card-meaning {
        font-size: 0.9rem;
    }
    
    .user-card {
        padding: 0.8rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-input-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #clearSearch {
        width: 100%;
    }
}

/* Dark mode support (for future) */
@media (prefers-color-scheme: dark) {
    /* Sẽ được thêm trong tương lai */
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .message-content {
        border: 2px solid #be185d;
    }
    
    .btn, .send-btn {
        border: 2px solid #ffffff;
    }
    
    .user-card, .post-item {
        border: 2px solid #ec4899;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tarot-card:hover {
        transform: none;
    }
    
    .user-card:hover, .post-item:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .auth-container,
    .home-container,
    .chat-container {
        background: white !important;
    }
    
    .input-container,
    .chat-header,
    .home-header {
        display: none !important;
    }
    
    .messages {
        background: white !important;
        box-shadow: none !important;
    }
    
    .message-content {
        border: 1px solid #ccc !important;
        background: white !important;
        color: black !important;
    }
}

/* Additional romantic touches */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(190, 24, 93, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Heart decoration for own messages - FIXED */
.message.own .message-content::after {
    content: '💕';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 14px;
    opacity: 0.8;
    animation: heartBeat 2s infinite;
}

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

/* Hover effect for reaction picker */
.reaction-picker span:hover {
    background: #fce7f3;
    border-radius: 4px;
    transform: scale(1.2);
}