/* CSS Fixes for Text Visibility and Layout Issues */

/* Ensure all text is visible by default */
* {
    -webkit-text-fill-color: initial;
}

/* Headings should be white by default */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

/* Only apply gradient to specific elements */
.gradient-text-effect {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fix for gradient backgrounds on buttons */
.gradient-bg {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb) !important;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white !important;
}

/* Ensure button text is always visible */
.gradient-bg * {
    color: white !important;
}

/* Fix neon text to be visible */
.neon-text {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5), 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Fix for table text */
table {
    color: #e5e7eb;
}

table th {
    color: #9ca3af !important;
}

table td {
    color: #e5e7eb !important;
}

/* CRITICAL FIX: Form inputs with proper dark backgrounds and cyan text */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="tel"],
textarea,
select {
    background-color: rgba(31, 41, 55, 0.8) !important; /* Dark gray background */
    color: #06b6d4 !important; /* Cyan text color */
    border: 1px solid rgba(75, 85, 99, 0.5) !important;
}

/* Input focus states */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    background-color: rgba(31, 41, 55, 0.95) !important;
    color: #22d3ee !important; /* Brighter cyan on focus */
    border-color: #06b6d4 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1) !important;
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
    color: #6b7280 !important; /* Gray placeholder */
    opacity: 0.7;
}

/* File inputs */
input[type="file"] {
    color: #06b6d4 !important;
}

/* Checkbox and radio buttons */
input[type="checkbox"],
input[type="radio"] {
    background-color: rgba(31, 41, 55, 0.8) !important;
    border-color: rgba(75, 85, 99, 0.5) !important;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #06b6d4 !important;
    border-color: #06b6d4 !important;
}

/* Select dropdowns */
select option {
    background-color: #1f2937 !important;
    color: #06b6d4 !important;
}

/* Disabled inputs */
input:disabled,
textarea:disabled,
select:disabled {
    background-color: rgba(31, 41, 55, 0.5) !important;
    color: #6b7280 !important;
    opacity: 0.6;
}

/* Ensure links are visible with cyan color */
a {
    color: #06b6d4 !important;
    text-decoration: none;
}

a:hover {
    color: #22d3ee !important;
}

/* Fix for cards */
.glass-card, .glass {
    color: #e5e7eb;
}

/* Ensure all icons are visible */
i, .fas, .fab, .far {
    color: inherit;
}

/* Fix for alerts - keep their original colors */
.bg-red-600, .bg-red-500 {
    color: white !important;
}

.bg-green-600, .bg-green-500 {
    color: white !important;
}

.bg-yellow-600, .bg-yellow-500 {
    color: white !important;
}

.bg-blue-600, .bg-blue-500 {
    color: white !important;
}

/* Text color utilities */
.text-white {
    color: #ffffff !important;
}

.text-gray-300 {
    color: #d1d5db !important;
}

.text-gray-400 {
    color: #9ca3af !important;
}

.text-gray-500 {
    color: #6b7280 !important;
}

/* Cyan color variations */
.text-cyan-400 {
    color: #22d3ee !important;
}

.text-cyan-500 {
    color: #06b6d4 !important;
}

/* Status colors */
.text-blue-400 {
    color: #60a5fa !important;
}

.text-green-400 {
    color: #4ade80 !important;
}

.text-red-400 {
    color: #f87171 !important;
}

.text-yellow-400 {
    color: #facc15 !important;
}

.text-purple-400 {
    color: #c084fc !important;
}

.text-orange-400 {
    color: #fb923c !important;
}

/* Background colors for badges */
.bg-blue-500\/20 {
    background-color: rgba(59, 130, 246, 0.2) !important;
}

.bg-green-500\/20 {
    background-color: rgba(34, 197, 94, 0.2) !important;
}

.bg-red-500\/20 {
    background-color: rgba(239, 68, 68, 0.2) !important;
}

.bg-yellow-500\/20 {
    background-color: rgba(234, 179, 8, 0.2) !important;
}

/* Fix for code blocks */
code, pre {
    color: #06b6d4 !important;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
}

/* Ensure proper contrast for labels */
label {
    color: #e5e7eb !important;
}

/* Fix for small text */
.text-sm {
    color: inherit;
}

.text-xs {
    color: inherit;
}

/* Fix for buttons */
button {
    color: white;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Fix for navigation links */
nav a {
    color: #d1d5db !important;
}

nav a:hover {
    color: #ffffff !important;
}

nav a.text-blue-400 {
    color: #60a5fa !important;
}

/* Fix for dropdown menus */
[x-show] {
    color: #e5e7eb;
}

/* Fix for modal/overlay text */
.modal, .overlay {
    color: #e5e7eb;
}

/* Responsive text sizing */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
}

/* Fix for overflow issues */
.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix for long text */
.break-words {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix for scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
}

/* Fix for focus states */
*:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

/* Fix for loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Fix for empty states */
.empty-state {
    color: #9ca3af;
    text-align: center;
    padding: 3rem 1rem;
}

/* Ensure proper spacing */
.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-x-4 > * + * {
    margin-left: 1rem;
}

/* Fix for transitions */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* Fix for backdrop blur */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
}

/* Fix for specific admin panel inputs */
.bg-gray-700 {
    background-color: rgba(55, 65, 81, 0.8) !important;
}

.bg-gray-700:focus {
    background-color: rgba(55, 65, 81, 0.95) !important;
}

/* Fix for white backgrounds */
.bg-white\/5 {
    background-color: rgba(31, 41, 55, 0.8) !important;
}

.bg-white\/10 {
    background-color: rgba(31, 41, 55, 0.9) !important;
}

/* Ensure paragraph text is visible */
p {
    color: #d1d5db;
}

/* Fix for span elements */
span {
    color: inherit;
}

/* Fix for div elements */
div {
    color: inherit;
}

/* Animation for gradient shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Fix for navbar dropdown visibility */
nav {
    overflow: visible !important;
}

nav .container {
    overflow: visible !important;
}

/* Ensure dropdown menu is visible and positioned correctly */
#userDropdownMenu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 0.5rem !important;
    z-index: 9999 !important;
    min-width: 12rem !important;
}

/* Fix for relative positioning */
#userDropdown {
    position: relative !important;
}

/* Ensure the dropdown appears above everything */
.z-50 {
    z-index: 9999 !important;
}

/* Fix for fixed navbar */
.fixed {
    overflow: visible !important;
}

/* Additional dropdown styling */
#userDropdownMenu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #d1d5db !important;
    transition: background-color 0.2s;
}

#userDropdownMenu a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

#userDropdownMenu hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* Ensure dropdown shadow is visible */
.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4) !important;
}

/* Fix for gradient text - prevent invisible text */
.bg-clip-text {
    -webkit-text-fill-color: white !important;
    background-clip: unset !important;
    -webkit-background-clip: unset !important;
}

/* Hero title glow effect */
.hero-title {
    color: #ffffff !important;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.6), 
                 0 0 60px rgba(118, 75, 162, 0.4),
                 0 0 90px rgba(102, 126, 234, 0.2) !important;
}

/* Prevent text-transparent from making text invisible */
.text-transparent {
    color: white !important;
    -webkit-text-fill-color: white !important;
}

/* Better gradient text effect that's actually visible */
.gradient-text-visible {
    background: linear-gradient(135deg, #ffffff 0%, #06b6d4 50%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* Ensure all hero section text is visible */
.hero-section h1,
.hero-section h2,
.hero-section h3 {
    color: #ffffff !important;
}

/* Fix for any remaining invisible text issues */
span[class*="gradient"],
div[class*="gradient"] {
    color: inherit;
}

span[class*="bg-clip"],
div[class*="bg-clip"] {
    -webkit-text-fill-color: white !important;
}
