/* Custom styles for argus⋮notes */

/* Base styles */
* {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Text truncation utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Modal styles */
#postModal {
    backdrop-filter: blur(4px);
}

#postModal .bg-gray-800 {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Card hover effects */
article {
    transition: all 0.3s ease;
}

article:hover {
    transform: translateY(-2px);
}

/* Button hover effects */
button, .btn {
    transition: all 0.2s ease;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
}

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

/* Focus styles */
input:focus, textarea:focus, select:focus {
    ring-offset-color: #111827;
}

/* File input styling */
input[type="file"]::-webkit-file-upload-button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    margin-right: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: #1d4ed8;
}

/* Custom checkbox and radio styles */
input[type="checkbox"], input[type="radio"] {
    accent-color: #2563eb;
}

/* Loading spinner */
.spinner {
    border: 2px solid #374151;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Responsive typography */
@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
}

/* Form styling improvements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    color: #f9fafb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Tag styling */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #2563eb;
    color: #dbeafe;
    font-size: 0.75rem;
    border-radius: 9999px;
    margin: 0.125rem;
}

/* Pagination styling */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 0.75rem;
    background-color: #374151;
    color: #d1d5db;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.pagination a:hover {
    background-color: #4b5563;
}

.pagination a.active {
    background-color: #2563eb;
    color: white;
}

/* Message styling */
.message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.message.success {
    background-color: #064e3b;
    color: #a7f3d0;
    border-color: #059669;
}

.message.error {
    background-color: #7f1d1d;
    color: #fca5a5;
    border-color: #dc2626;
}

.message.info {
    background-color: #1e3a8a;
    color: #93c5fd;
    border-color: #2563eb;
}

/* Image lazy loading */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-gray-800, .bg-gray-900 {
        background: white !important;
        color: black !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-800 {
        background-color: #000 !important;
        border-color: #fff !important;
    }
    
    .text-gray-300 {
        color: #fff !important;
    }
    
    .text-gray-400 {
        color: #ccc !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode utilities */
.dark-mode-toggle {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background: #374151;
    color: #f9fafb;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 40;
}

.dark-mode-toggle:hover {
    background: #4b5563;
    transform: scale(1.1);
}

/* Custom utilities */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Improve touch targets */
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better modal on mobile */
    #postModal .bg-gray-800 {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        border-radius: 1rem;
    }
    
    /* Stack form elements better on mobile */
    .form-row {
        flex-direction: column;
    }
    
    .form-row > * {
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.focus-visible:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Custom selection colors */
::selection {
    background-color: #2563eb;
    color: white;
}

::-moz-selection {
    background-color: #2563eb;
    color: white;
}