/* Modern Dashboard Theme Styles */

/* ===== Base Styles ===== */
/* Body styles now handled by Tailwind classes in base.html */

/* Smooth transitions for interactive elements */
a, button, input, textarea, select {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Better focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgb(126 34 206); /* purple-700 */
    outline-offset: 2px;
}

/* Card hover effects - used in components */
.card:hover {
    box-shadow: 0 10px 15px -3px rgba(168, 85, 247, 0.2), 0 4px 6px -2px rgba(168, 85, 247, 0.1);
    border-color: rgb(107 114 128); /* border-gray-500 on hover */
}



/* ===== Button Styles ===== */
.btn {
    @apply inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2;
}

.btn-primary {
    @apply bg-purple-700 text-white hover:bg-purple-600 focus:ring-purple-600;
}

.btn-secondary {
    @apply bg-white text-gray-700 border border-gray-300 hover:bg-gray-50 focus:ring-gray-500;
}

.btn-success {
    @apply bg-green-600 text-white hover:bg-green-700 focus:ring-green-500;
}

.btn-danger {
    @apply bg-red-600 text-white hover:bg-red-700 focus:ring-red-500;
}

.btn-warning {
    @apply bg-amber-600 text-white hover:bg-amber-700 focus:ring-amber-500;
}

/* Button sizes */
.btn-sm {
    @apply px-3 py-1.5 text-xs;
}

.btn-lg {
    @apply px-6 py-3 text-base;
}

/* ===== Form Styles ===== */
.form-group {
    @apply mb-4;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-1;
}

.form-input {
    @apply block w-full px-3 py-2 border border-gray-600 rounded-lg shadow-sm text-sm 
           focus:ring-purple-600 focus:border-purple-600 bg-gray-700 text-white;
}

.form-input:disabled {
    @apply bg-gray-100 cursor-not-allowed;
}

.form-textarea {
    @apply block w-full px-3 py-2 border border-gray-600 rounded-lg shadow-sm text-sm 
           focus:ring-purple-600 focus:border-purple-600 bg-gray-700 text-white;
}

.form-select {
    @apply block w-full px-3 py-2 border border-gray-600 rounded-lg shadow-sm text-sm 
           focus:ring-purple-600 focus:border-purple-600 bg-gray-700 text-white;
}

.form-checkbox {
    @apply h-4 w-4 text-purple-600 border-gray-600 rounded focus:ring-purple-600;
}

.form-radio {
    @apply h-4 w-4 text-purple-600 border-gray-600 focus:ring-purple-600;
}

/* ===== Badge Styles ===== */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-primary {
    @apply bg-purple-700/25 text-purple-300;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-warning {
    @apply bg-amber-100 text-amber-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

.badge-info {
    @apply bg-cyan-100 text-cyan-800;
}

.badge-gray {
    @apply bg-gray-100 text-gray-800;
}

/* ===== Table Styles ===== */
.data-table {
    @apply bg-gray-800 rounded-lg shadow-sm border border-gray-700 overflow-hidden;
}

.data-table thead {
    @apply bg-gray-50;
}

.data-table th {
    @apply px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.data-table td {
    @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
}

.data-table tbody tr {
    @apply border-t border-gray-200;
}

.data-table tbody tr:hover {
    @apply bg-gray-50;
}

/* ===== Activity/Timeline Styles ===== */
.activity-feed {
    @apply space-y-4;
}

.activity-item {
    @apply flex items-start;
}

.activity-indicator {
    @apply flex-shrink-0 w-2 h-2 rounded-full mt-2;
}

.activity-content {
    @apply ml-4 flex-1;
}

.activity-title {
    @apply text-sm font-medium text-gray-900;
}

.activity-time {
    @apply text-sm text-gray-500;
}

/* ===== Alert Styles ===== */
.alert {
    @apply p-4 rounded-lg;
}

.alert-info {
    @apply bg-blue-50 text-blue-800 border border-blue-200;
}

.alert-success {
    @apply bg-green-50 text-green-800 border border-green-200;
}

.alert-warning {
    @apply bg-amber-50 text-amber-800 border border-amber-200;
}

.alert-danger {
    @apply bg-red-50 text-red-800 border border-red-200;
}

/* ===== Loading States ===== */
.loading {
    @apply opacity-50 pointer-events-none;
}

.spinner {
    @apply animate-spin h-5 w-5 text-blue-600;
}

/* ===== Masonry Gallery Layout ===== */
.masonry-gallery {
    column-count: 2;
    column-gap: 1rem;
}

@media (min-width: 768px) {
    .masonry-gallery {
        column-count: 3;
    }
}

@media (min-width: 1024px) {
    .masonry-gallery {
        column-count: 4;
    }
}

.masonry-gallery > div {
    @apply mb-4;
    break-inside: avoid;
    display: inline-block;
    width: 100%;
}

.masonry-gallery img {
    @apply rounded-t-lg block w-full h-auto;
}

.masonry-gallery .group:hover .opacity-0 {
    opacity: 1;
}

/* Success glow effect - temporary green outline */
.field-success {
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5), 0 0 8px rgba(34, 197, 94, 0.3) !important;
    border-color: rgb(34, 197, 94) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Error glow effect - persistent red outline */
.field-error {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.5), 0 0 8px rgba(239, 68, 68, 0.3) !important;
    border-color: rgb(239, 68, 68) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Loading state - subtle blue glow */
.field-loading {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3), 0 0 6px rgba(59, 130, 246, 0.2) !important;
    border-color: rgb(59, 130, 246) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Dark mode adjustments */
.dark .field-success {
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.6), 0 0 10px rgba(34, 197, 94, 0.4) !important;
}

.dark .field-error {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.6), 0 0 10px rgba(239, 68, 68, 0.4) !important;
}

.dark .field-loading {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4), 0 0 8px rgba(59, 130, 246, 0.3) !important;
}

/* ===== Sidebar Specific Styles ===== */
.sidebar-link {
    @apply flex items-center px-3 py-2 text-sm font-medium rounded-lg transition-colors;
}

.sidebar-link:hover {
    @apply bg-gray-700 text-white;
}

.sidebar-link.active {
    @apply bg-purple-700 text-white border-l-4 border-purple-600;
}

.sidebar-icon {
    @apply w-5 h-5 mr-3;
}

/* ===== Page Headers ===== */
.page-header {
    @apply mb-6;
}

.page-title {
    @apply text-2xl font-bold text-gray-900;
}

.page-subtitle {
    @apply mt-1 text-sm text-gray-500;
}

/* ===== Utility Classes ===== */
.text-primary {
    @apply text-purple-300;
}

.text-success {
    @apply text-green-600;
}

.text-warning {
    @apply text-amber-600;
}

.text-danger {
    @apply text-red-600;
}

.bg-primary {
    @apply bg-purple-700;
}

.bg-success {
    @apply bg-green-600;
}

.bg-warning {
    @apply bg-amber-600;
}

.bg-danger {
    @apply bg-red-600;
}

/* ===== Responsive Utilities ===== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

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

/* ===== Animation Classes ===== */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

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

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

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

::-webkit-scrollbar-track {
    @apply bg-gray-100;
}

::-webkit-scrollbar-thumb {
    @apply bg-gray-400 rounded;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-gray-500;
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* ===== Sidebar Specific Styles ===== */
.sidebar-link {
    @apply flex items-center px-3 py-2 text-sm font-medium rounded-lg transition-colors;
}

.sidebar-link:hover {
    @apply bg-gray-700 text-white;
}

.sidebar-link.active {
    @apply bg-purple-700 text-white border-l-4 border-purple-600;
}

.sidebar-icon {
    @apply w-5 h-5 mr-3;
}

/* ===== Page Headers ===== */
.page-header {
    @apply mb-6;
}

.page-title {
    @apply text-2xl font-bold text-gray-900;
}

.page-subtitle {
    @apply mt-1 text-sm text-gray-500;
}

/* ===== Utility Classes ===== */
.text-primary {
    @apply text-purple-300;
}

.text-success {
    @apply text-green-600;
}

.text-warning {
    @apply text-amber-600;
}

.text-danger {
    @apply text-red-600;
}

.bg-primary {
    @apply bg-purple-700;
}

.bg-success {
    @apply bg-green-600;
}

.bg-warning {
    @apply bg-amber-600;
}

.bg-danger {
    @apply bg-red-600;
}

/* ===== Responsive Utilities ===== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

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

/* ===== Animation Classes ===== */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

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

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

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

::-webkit-scrollbar-track {
    @apply bg-gray-100;
}

::-webkit-scrollbar-thumb {
    @apply bg-gray-400 rounded;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-gray-500;
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}