/* Dark Theme for QXL Ideas App */

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #242424;
    --bg-hover: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --accent-primary: #8b9ff5;
    --accent-secondary: #a78bfa;
}

/* Base Styles */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

/* Navigation */
.navbar {
    background: rgba(26, 26, 26, 0.95) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 20px var(--shadow-color) !important;
}

/* Projects Header/Toolbar Area */
.projects-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16161d 100%) !important;
    padding: 1.5rem !important;
    border-radius: 12px !important;
    margin-bottom: 1.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.projects-header h2 {
    color: #e0e0e0 !important;
    font-weight: 600 !important;
}

.projects-header h2 i {
    color: var(--accent-primary) !important;
}

.projects-controls {
    background: transparent !important;
}

.projects-toolbar {
    background: transparent !important;
}

.nav-link {
    color: var(--text-secondary) !important;
}

.nav-link:hover {
    color: var(--accent-primary) !important;
    background: rgba(139, 159, 245, 0.15) !important;
}

.nav-link.active {
    color: var(--accent-primary) !important;
    background: rgba(139, 159, 245, 0.2) !important;
}

.hamburger span {
    background: var(--text-primary) !important;
}

/* Main Content */
.main-content {
    background: transparent !important;
}

.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%) !important;
}

.hero h1,
.hero h2,
.hero p {
    color: var(--text-primary) !important;
}

/* Cards and Containers */
.auth-card,
.project-card,
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 40px var(--shadow-color) !important;
}

.auth-card h2,
.project-card h3,
.modal-header h3 {
    color: var(--text-primary) !important;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select,
.form-control {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus,
.form-control:focus {
    background: var(--bg-hover) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(139, 159, 245, 0.1) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
}

label {
    color: var(--text-secondary) !important;
}

/* Buttons - Keep colorful buttons vibrant */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7b8ff5 0%, #8a5db8 100%) !important;
}

.btn-secondary {
    background: #4a4a4a !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.btn-secondary:hover {
    background: #5a5a5a !important;
}

.btn-danger {
    background: #dc3545 !important;
    color: white !important;
}

/* Attachment and action buttons in project cards */
.project-attachments-btn,
.project-todos-btn,
.project-edit-btn,
.project-delete-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-secondary) !important;
}

.project-attachments-btn:hover,
.project-todos-btn:hover,
.project-edit-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Ensure paperclip icon inherits color */
.project-attachments-btn i.fa-paperclip,
.project-attachments-btn i.fas.fa-paperclip {
    color: inherit !important;
}

/* Target attachment button more specifically - force dark theme */
button[onclick*="showAttachmentModal"],
button[onclick*="attachment"],
button[onclick*="Attachment"],
.btn:has(i.fa-paperclip),
.project-card button:has(.fa-paperclip),
button.project-attachments-btn {
    background: rgba(30, 30, 30, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #b0b0b0 !important;
}

button[onclick*="showAttachmentModal"]:hover,
button[onclick*="attachment"]:hover,
button[onclick*="Attachment"]:hover,
.btn:has(i.fa-paperclip):hover,
.project-card button:has(.fa-paperclip):hover,
button.project-attachments-btn:hover {
    background: rgba(50, 50, 50, 0.8) !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Force dark background on ALL attachment buttons */
.project-card .project-actions button[title*="ttachment"],
.project-card .project-actions button[title*="iles"] {
    background: rgba(30, 30, 30, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #b0b0b0 !important;
}

/* Target the attachment-count div specifically */
.attachment-count {
    background: rgba(30, 30, 30, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #b0b0b0 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 6px !important;
}

.attachment-count:hover {
    background: rgba(50, 50, 50, 0.8) !important;
    color: #e0e0e0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.attachment-count i,
.attachment-count span {
    color: inherit !important;
}

/* Also target by title attribute */
div[title*="add files"],
div[title*="Add files"] {
    background: rgba(30, 30, 30, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #b0b0b0 !important;
}

.project-delete-btn:hover {
    background: rgba(220, 53, 69, 0.2) !important;
    border-color: rgba(220, 53, 69, 0.4) !important;
    color: #ff6b7d !important;
}

/* Icon buttons styling */
.project-attachments-btn i,
.project-todos-btn i,
.project-edit-btn i,
.project-delete-btn i {
    color: inherit !important;
}

/* Small buttons in cards */
.btn-sm {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-secondary) !important;
}

.btn-sm:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
}

/* Project Cards */
.project-card {
    background: var(--bg-card) !important;
}

.project-card:hover {
    background: var(--bg-hover) !important;
    transform: translateY(-5px);
}

.project-title {
    color: var(--text-primary) !important;
}

.project-description {
    color: var(--text-secondary) !important;
}

.project-meta {
    color: var(--text-muted) !important;
}

/* Project card action buttons row */
.project-actions {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 0.75rem !important;
}

.project-actions .btn {
    font-size: 0.9rem !important;
}

/* Status Badges */
.status-badge {
    opacity: 0.9;
}

.priority-badge {
    opacity: 0.9;
}

/* Todo Items */
.todo-item {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.todo-item:hover {
    background: var(--bg-hover) !important;
}

.todo-item.completed {
    background: rgba(128, 128, 128, 0.1) !important;
    opacity: 0.6;
}

.todo-text-editable {
    color: var(--text-primary) !important;
}

.todo-text-editable:focus {
    background-color: var(--bg-secondary) !important;
    border-color: var(--accent-primary) !important;
}

.todo-text-editable:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.todo-input {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Todo Stats Bar */
.todo-stats {
    background: rgba(30, 30, 30, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
}

.todo-stats .stat-item {
    color: var(--text-secondary) !important;
}

.todo-stats .stat-item strong {
    color: var(--text-primary) !important;
}

.todo-stats .stat-item i {
    color: var(--accent-primary) !important;
}

/* Modals */
.modal {
    background: rgba(0, 0, 0, 0.8) !important;
}

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

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-close {
    color: var(--text-secondary) !important;
}

.modal-close:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Dropdowns */
.dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.dropdown-option {
    color: var(--text-primary) !important;
}

.dropdown-option:hover {
    background: var(--bg-hover) !important;
}

/* Search Component */
.qxl-search-component {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.projects-header .qxl-search-component {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.search-input {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.search-icon {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Toolbar buttons in header */
.projects-header .toolbar-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.projects-header .toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.projects-header .toolbar-btn.active {
    background: rgba(139, 159, 245, 0.2) !important;
    border-color: rgba(139, 159, 245, 0.4) !important;
    color: var(--accent-primary) !important;
}

.projects-header .btn-primary-toolbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
}

.toolbar-divider {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Tables */
.projects-table {
    background: var(--bg-card) !important;
}

.projects-table th {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.projects-table td {
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.projects-table tbody tr:hover {
    background: var(--bg-hover) !important;
}

/* Stats */
.stat-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.stat-value {
    color: var(--text-primary) !important;
}

.stat-label {
    color: var(--text-secondary) !important;
}

/* KPI Tags */
.project-todo-kpis {
    background: var(--bg-secondary) !important;
}

.kpi-tag {
    background: rgba(139, 159, 245, 0.15) !important;
    color: var(--accent-primary) !important;
}

/* Progress Bar */
.project-progress-container {
    background: var(--bg-secondary) !important;
}

.project-progress-bar {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Attachments */
.attachment-item {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.attachment-item:hover {
    background: var(--bg-hover) !important;
}

/* Add attachment link button */
.add-attachment-link,
.attachments-section a[onclick*="showAttachmentModal"],
.attachments-list + a,
.attachments-empty a {
    background: rgba(139, 159, 245, 0.1) !important;
    color: var(--accent-primary) !important;
    border: 1px solid rgba(139, 159, 245, 0.2) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
}

.add-attachment-link:hover,
.attachments-section a[onclick*="showAttachmentModal"]:hover,
.attachments-list + a:hover,
.attachments-empty a:hover {
    background: rgba(139, 159, 245, 0.25) !important;
    border-color: rgba(139, 159, 245, 0.4) !important;
    color: #a8bfff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(139, 159, 245, 0.15) !important;
}

/* Empty States */
.todo-empty-state,
.empty-state {
    color: var(--text-muted) !important;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #404040;
}

/* Pull to Refresh */
.pull-to-refresh {
    background: var(--bg-secondary) !important;
}

.pull-to-refresh-text {
    color: var(--accent-primary) !important;
}

/* Links */
a {
    color: var(--accent-primary) !important;
}

a:hover {
    color: var(--accent-secondary) !important;
}

/* Feature Cards on Home */
.feature-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.feature-card h3 {
    color: var(--text-primary) !important;
}

.feature-card p {
    color: var(--text-secondary) !important;
}

/* Alert Messages */
.alert {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.alert-error {
    background: rgba(220, 53, 69, 0.1) !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1) !important;
    border-color: rgba(40, 167, 69, 0.3) !important;
}

/* Toast Notifications */
.toast {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Custom Checkbox */
input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}