/* Online Multi-User Notepad - Custom Styles */

/* Base wrapper */
.omun-notepad-wrapper {
    padding: 20px 0;
    transition: background-color 0.3s ease;
}

/* Dark mode enabled */
.dark .omun-notepad-wrapper {
    background-color: #111827;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Smooth transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Text area styling */
#noteContent {
    min-height: 400px;
}

/* Toastr customizations */
.toast-success {
    background-color: #10b981 !important;
}

.toast-info {
    background-color: #3b82f6 !important;
}

.toast-warning {
    background-color: #f59e0b !important;
}

/* User avatars */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Content editable placeholder */
#noteContent:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    cursor: text;
}

.dark #noteContent:empty:before {
    color: #6b7280;
}

/* List styles in contenteditable */
#noteContent ul,
#noteContent ol {
    margin-left: 20px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    padding-left: 20px !important;
}

#noteContent ul {
    list-style-type: disc !important;
}

#noteContent ol {
    list-style-type: decimal !important;
}

#noteContent li {
    display: list-item !important;
    margin-bottom: 5px !important;
}

/* Fullscreen Mode Styles */
.omun-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #ffffff !important;
    overflow: hidden !important;
}

.dark .omun-fullscreen {
    background-color: #1f2937 !important;
}

/* Hide everything except notepad in fullscreen */
.omun-fullscreen header,
.omun-fullscreen .lg\:col-span-1,
.omun-fullscreen > .container > .grid > .lg\:col-span-1 {
    display: none !important;
}

/* Hide activity section in fullscreen */
.omun-fullscreen .mt-6 {
    display: none !important;
}

/* Make container fill screen */
.omun-fullscreen > .container {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Make grid fill screen */
.omun-fullscreen .grid {
    display: flex !important;
    height: 100vh !important;
    width: 100% !important;
    gap: 0 !important;
}

/* Make notepad column full width */
.omun-fullscreen .lg\:col-span-2 {
    width: 100% !important;
    height: 100vh !important;
    flex: 1 !important;
}

/* Make notepad card fill screen */
.omun-fullscreen .lg\:col-span-2 > .bg-white {
    height: 100vh !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
}

/* Style the notepad header in fullscreen */
.omun-fullscreen .bg-gradient-to-r.from-blue-500 {
    flex-shrink: 0 !important;
}

/* Style toolbar in fullscreen */
.omun-fullscreen .flex.flex-wrap.items-center.p-4 {
    flex-shrink: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.dark .omun-fullscreen .flex.flex-wrap.items-center.p-4 {
    border-bottom-color: #374151 !important;
}

/* Make content area flexible */
.omun-fullscreen .p-1 {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
}

/* Style notepad content in fullscreen */
.omun-fullscreen #noteContent {
    flex: 1 !important;
    min-height: 0 !important;
    max-height: none !important;
    height: 100% !important;
    overflow-y: auto !important;
    padding: 20px !important;
}

/* Style footer in fullscreen */
.omun-fullscreen .p-4.border-t {
    flex-shrink: 0 !important;
}

/* Explicit Dark Mode Styles */
.dark .bg-white {
    background-color: #1f2937 !important;
}

.dark .bg-gray-50 {
    background-color: #111827 !important;
}

.dark .bg-gray-100 {
    background-color: #1f2937 !important;
}

.dark .bg-gray-800 {
    background-color: #1f2937 !important;
}

.dark .bg-gray-900 {
    background-color: #111827 !important;
}

.dark .text-gray-800 {
    color: #f9fafb !important;
}

.dark .text-gray-700 {
    color: #e5e7eb !important;
}

.dark .text-gray-600 {
    color: #d1d5db !important;
}

.dark .text-white {
    color: #ffffff !important;
}

.dark .border-gray-700 {
    border-color: #374151 !important;
}

.dark .border-gray-600 {
    border-color: #4b5563 !important;
}

.dark input,
.dark textarea,
.dark select {
    background-color: #374151 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}

.dark button {
    transition: all 0.3s ease;
}

.dark .hover\:bg-gray-200:hover {
    background-color: #374151 !important;
}

.dark .hover\:bg-gray-700:hover {
    background-color: #4b5563 !important;
}

.dark .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

.dark .bg-gray-700 {
    background-color: #374151 !important;
}

.dark .bg-green-50 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.dark .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.dark .bg-yellow-50 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

.dark .bg-purple-50 {
    background-color: rgba(139, 92, 246, 0.1) !important;
}

.dark .bg-orange-50 {
    background-color: rgba(249, 115, 22, 0.1) !important;
}

/* Dark mode for content area */
.dark #noteContent {
    background-color: #1f2937 !important;
    color: #f9fafb !important;
}

/* Dark mode for modals */
.dark #shareModal .bg-white,
.dark #inviteModal .bg-white {
    background-color: #1f2937 !important;
}

/* Dark mode text colors for specific elements */
.dark .text-gray-300 {
    color: #d1d5db !important;
}

.dark .text-gray-400 {
    color: #9ca3af !important;
}

.dark .text-gray-500 {
    color: #6b7280 !important;
}

/* Print styles */
@media print {
    .omun-notepad-wrapper header,
    .omun-notepad-wrapper .lg\:col-span-1,
    .omun-notepad-wrapper .mt-6,
    #shareModal,
    #addPersonModal,
    .bg-gradient-to-r.from-blue-500.to-blue-600 button,
    .flex.flex-wrap.items-center.p-4.border-b {
        display: none !important;
    }
    
    .omun-notepad-wrapper .lg\:col-span-2 {
        grid-column: span 3;
    }
    
    #noteContent {
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Modal animations */
.modal-fade-in {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Pulse animation for live indicator */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Hover effects */
button:focus {
    outline: none;
}

button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .omun-notepad-wrapper .container {
        padding: 10px;
    }
    
    .omun-notepad-wrapper h1 {
        font-size: 1.5rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Dark mode transitions */
.dark * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Selection styles */
::selection {
    background-color: #3b82f6;
    color: white;
}

.dark ::selection {
    background-color: #60a5fa;
    color: white;
}

/* Focus styles for accessibility */
input:focus,
button:focus,
[contenteditable]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}
