/* Dark Theme Loading States and Default Styling */
/* Include this file to ensure all loading states are properly themed */

/* Loading State Defaults */
.loading-state,
.widget-loading,
.notification-empty,
.empty-state {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Loading Spinners */
.loading-spinner {
    color: var(--accent-blue) !important;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error States */
.error-state,
.widget-error {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: var(--accent-red) !important;
    border-radius: 8px;
    padding: 15px;
}

/* Success States */
.success-state,
.widget-success {
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    color: var(--accent-green) !important;
    border-radius: 8px;
    padding: 15px;
}

/* Override any white backgrounds */
.widget,
.widget-container,
.social-item,
.news-card,
.post-card,
.event-card,
.user-card {
    background: var(--card-bg) !important;
}

/* Input field defaults */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="search"],
select,
textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
}

input:focus,
select:focus,
textarea:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--accent-blue) !important;
    outline: none !important;
}

/* Button defaults */
button,
.btn {
    background: var(--accent-blue) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Modal and overlay defaults */
.modal,
.overlay,
.modal-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
}

.modal-content,
.modal-dialog {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Prevent any white flashes */
* {
    scrollbar-color: var(--border-color) var(--card-bg) !important;
}

/* AdSense and ad container defaults */
ins.adsbygoogle,
.ad-container,
.ad-placeholder {
    background: transparent !important;
    min-height: 100px;
    border: 1px dashed rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
}

/* Table styling for dark theme */
table {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

th {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
}

/* Code blocks */
pre,
code {
    background: rgba(0, 0, 0, 0.5) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px;
    padding: 10px;
}

/* Form validation messages */
.invalid-feedback,
.validation-error {
    background: rgba(239, 68, 68, 0.1) !important;
    color: var(--accent-red) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

/* Skeleton loading animations */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    ) !important;
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Ensure all text is properly colored */
p, div, span, label, li, td, th {
    color: inherit;
}

/* Fix any remaining white backgrounds */
[style*="background: white"],
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background-color: white"],
[style*="background-color:#fff"],
[style*="background-color: #fff"] {
    background: var(--card-bg) !important;
}

/* Loading button states */
button:disabled,
.btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

button.loading,
.btn.loading {
    position: relative;
}

button.loading::before,
.btn.loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}


