/* Joovili - Custom Styles */
/* Most styling is handled by Tailwind CSS via CDN */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Slide Animations */
.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Post Card Styling */
.post-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
}

/* Reaction Button Animation */
.reaction-btn.active {
    animation: pulse 0.3s ease;
}

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

/* Story Ring */
.story-ring {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    padding: 3px;
    border-radius: 50%;
}

.story-ring-viewed {
    background: #d1d5db;
}

/* Avatar Styling */
.avatar {
    object-fit: cover;
    background-color: #e5e7eb;
}

.avatar-online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
}

/* Dropdown Transitions */
.dropdown-menu {
    transform-origin: top right;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Modal Overlay */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Toast Notifications */
.toast {
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast-exit {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastOut {
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* Image Lazy Loading */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* Form Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Button States */
.btn {
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #3b82f6;
    border-radius: 50%;
    color: white;
    font-size: 10px;
}

/* Admin Sidebar */
.admin-sidebar {
    transition: width 0.3s ease;
}

.admin-sidebar.collapsed {
    width: 64px;
}

.admin-sidebar.collapsed .sidebar-text {
    display: none;
}

/* Responsive Images */
.responsive-image {
    max-width: 100%;
    height: auto;
}

/* Message Bubbles */
.message-bubble {
    max-width: 70%;
    word-wrap: break-word;
}

.message-sent {
    background-color: #3b82f6;
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message-received {
    background-color: #e5e7eb;
    color: #1f2937;
    border-radius: 18px 18px 18px 4px;
}

/* Emoji Picker Container */
.emoji-picker-container {
    position: absolute;
    z-index: 100;
}

/* Rich Text Editor */
.editor-content {
    min-height: 120px;
}

.editor-content:focus {
    outline: none;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .desktop-hidden {
        display: none !important;
    }
}
