/* Mobile UX Enhancements */

/* Dark Mode - Item #4 */
body.dark-mode {
    --bg-light: #121212;
    --text-main: #e0e0e0;
    --white: #1e1e1e;
    --navy-blue: #0f172a;
    background-color: var(--bg-light);
    color: var(--text-main);
}

body.dark-mode .container, 
body.dark-mode .card, 
body.dark-mode input, 
body.dark-mode textarea, 
body.dark-mode select {
    background-color: var(--white);
    color: var(--text-main);
    border-color: #333;
}

body.dark-mode header,
body.dark-mode footer {
    background-color: #0b1120;
}

body.dark-mode .nav-links {
    background-color: #0b1120;
}

body.dark-mode .secondary-header {
    background-color: #1e293b;
}

/* Floating Action Button (FAB) - Item #3 */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
}

.fab {
    width: 56px;
    height: 56px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
    border: none;
}

.fab:hover, .fab:active {
    background-color: var(--primary-hover);
    text-decoration: none;
    color: #ffffff;
}

.fab:active {
    transform: scale(0.92);
}

/* Pull to Refresh Indicator - Item #2 */
.ptr-container {
    text-align: center;
    padding: 10px;
    display: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 14px;
    background-color: var(--bg-light);
    transition: all 0.2s ease;
}

/* Dark Mode Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 44px; /* Touch target minimum */
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Dark Mode Specific Overrides for Readability */
body.dark-mode .text-muted {
    color: #9ca3af !important; /* Lighter grey for better contrast */
}

body.dark-mode a {
    color: #60a5fa; /* Lighter blue for links */
}

body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6,
body.dark-mode .text-navy-blue,
body.dark-mode .text-gray-800,
body.dark-mode .text-gray-700 {
    color: #f3f4f6 !important; /* Near white for headings */
}

body.dark-mode .card-header {
    background-color: #1e293b;
    color: #f3f4f6;
    border-bottom: 1px solid #333;
}

body.dark-mode .card-footer {
    background-color: #1e293b;
    border-top: 1px solid #333;
}

body.dark-mode .bg-gray-50, 
body.dark-mode .bg-light {
    background-color: #1e293b !important;
}

body.dark-mode .border-gray-200, 
body.dark-mode .border-bottom {
    border-color: #333 !important;
}

body.dark-mode .table th, 
body.dark-mode .table td {
    color: #e5e7eb;
    border-color: #333;
}

body.dark-mode .table thead {
    background-color: #1e293b;
}

body.dark-mode .table tbody tr:hover {
    background-color: #334155;
}

body.dark-mode .empty-state {
    background-color: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-mode .empty-state h3 {
    color: #f8fafc;
}

/* Additional Dark Mode Fixes */
body.dark-mode .text-dark {
    color: #e2e8f0 !important;
}

body.dark-mode .badge.bg-light.text-dark {
    background-color: #334155 !important;
    color: #f8fafc !important;
}

body.dark-mode .nav-links a {
    color: #e2e8f0;
}

body.dark-mode .secondary-nav-links a {
    color: #cbd5e1;
}

body.dark-mode .secondary-nav-links a:hover {
    color: #ffffff;
}
