/* Dark Mode Styles */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --shadow-lg: rgba(0, 0, 0, 0.2);
}

.dark-mode {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border-color: #4b5563;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

/* Apply theme variables */
body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Cards and containers */
.bg-white {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.bg-gray-50,
.bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
}

/* Text colors */
.text-gray-800,
.text-gray-900,
.text-slate-800,
.text-slate-900 {
    color: var(--text-primary) !important;
}

.text-gray-600,
.text-gray-700,
.text-slate-600,
.text-slate-700 {
    color: var(--text-secondary) !important;
}

.text-gray-500,
.text-slate-500 {
    color: var(--text-tertiary) !important;
}

.text-slate-400 {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Borders */
.border,
.border-gray-200,
.border-gray-300,
.border-slate-100,
.border-slate-200 {
    border-color: var(--border-color) !important;
}

.divide-gray-200>*+*,
.divide-slate-100>*+* {
    border-color: var(--border-color) !important;
}

/* Shadows */
.shadow,
.shadow-sm {
    box-shadow: 0 1px 3px var(--shadow) !important;
}

.shadow-md {
    box-shadow: 0 4px 6px var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px var(--shadow-lg) !important;
}

/* Forms */
.dark-mode input[type="text"],
.dark-mode input[type="email"],
.dark-mode input[type="password"],
.dark-mode input[type="number"],
.dark-mode input[type="date"],
.dark-mode input[type="url"],
.dark-mode input[type="tel"],
.dark-mode textarea,
.dark-mode select {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark-mode input[type="text"]:focus,
.dark-mode input[type="email"]:focus,
.dark-mode input[type="password"]:focus,
.dark-mode input[type="number"]:focus,
.dark-mode input[type="date"]:focus,
.dark-mode input[type="url"]:focus,
.dark-mode input[type="tel"]:focus,
.dark-mode textarea:focus,
.dark-mode select:focus {
    background-color: var(--bg-primary);
    border-color: #3b82f6;
}

/* Tables */
.dark-mode table {
    color: var(--text-primary);
}

.dark-mode thead {
    background-color: var(--bg-tertiary);
}

.dark-mode tbody tr:hover {
    background-color: var(--bg-tertiary);
}

/* Modals and dropdowns */
.dark-mode .dropdown-menu,
.dark-mode .modal-content {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

/* Code blocks */
.dark-mode code,
.dark-mode pre {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Hover states */
.dark-mode .hover\:bg-gray-50:hover,
.dark-mode .hover\:bg-gray-100:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Theme toggle button */
#theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

#theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.1);
}

#theme-toggle:active {
    transform: scale(0.95);
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
    }
}