/* ========== BASE STYLES ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: #fff5f7;
    color: #333;
    line-height: 1.6;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

body.dark-mode {
    background-color: #121212;
    color: #e8e8e8;
}

/* ========== HEADER ========== */
header {
    background: linear-gradient(135deg, #ffb7d5 0%, #ff85b3 100%);
    color: #7a0044;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.15);
    text-align: center;
    position: relative;
}

body.dark-mode header {
    background: linear-gradient(135deg, #c2185b 0%, #880e4f 100%);
    color: white;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

/* ========== DARK MODE TOGGLE ========== */
.dark-mode-toggle {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
    color: #ff85b3;
    font-size: 1.2rem;
    z-index: 10;
}

.dark-mode-toggle:hover {
    background: white;
    transform: scale(1.1);
}

body.dark-mode .dark-mode-toggle {
    background: rgba(255, 133, 179, 0.2);
    color: #ff85b3;
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 133, 179, 0.3);
}

/* ========== STATUS MESSAGES ========== */
.status {
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
    display: none;
    transition: all 0.3s;
}

.success {
    background: #d4edda;
    color: #155724;
}

body.dark-mode .success {
    background: #1b5e20;
    color: #c8e6c9;
}

.error {
    background: #f8d7da;
    color: #721c24;
}

body.dark-mode .error {
    background: #b71c1c;
    color: #ffcdd2;
}

/* ========== BABY TABS ========== */
.baby-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.1);
}

body.dark-mode .baby-tabs {
    background: rgba(40, 40, 40, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.baby-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    text-decoration: none !important;
    border: 2px solid transparent;
    border-bottom: none !important;
}

body.dark-mode .baby-tab {
    background: #333;
    color: #aaa;
    border-bottom: none !important;
}

.baby-tab:hover {
    transform: translateY(-2px);
    border-color: #ff85b3;
    border-bottom: none !important;
}

body.dark-mode .baby-tab:hover {
    border-color: #ff4081;
    color: #eee;
}

.baby-tab.active {
    background: #ff85b3;
    color: white;
    border-bottom: none !important;
    text-decoration: none !important;
}

body.dark-mode .baby-tab.active {
    background: #ff4081;
    border-bottom: none !important;
}

/* Remove pseudo-elements that create lines */
.baby-tab::before,
.baby-tab::after,
.baby-tab.active::before,
.baby-tab.active::after {
    content: none !important;
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    background: none !important;
    border: none !important;
}

/* ========== FORM STYLES ========== */
.form-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

body.dark-mode .form-group {
    background: #2d2d2d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #880e4f;
    font-size: 16px;
}

body.dark-mode label {
    color: #ffccd5;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ffccd5;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fffafc;
    color: #333;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #2a2a2a;
    border-color: #444;
    color: #ffffff;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #888;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #ff85b3;
    box-shadow: 0 0 0 3px rgba(255, 133, 179, 0.2);
    background-color: white;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    background-color: #2a2a2a;
    border-color: #ff85b3;
    box-shadow: 0 0 0 3px rgba(255, 133, 179, 0.3);
}

/* ========== CHECKBOX GRID STYLES ========== */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item-50 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    text-align: center;
    font-weight: bold;
}

body.dark-mode .checkbox-item-50 {
    background: #333;
    color: #ccc;
}

.checkbox-item-50:hover {
    border-color: #ff85b3;
    transform: translateY(-2px);
}

.checkbox-item-50 input {
    width: auto;
    transform: scale(1.3);
}

.checkbox-item-50.checked {
    background: #ff85b3;
    color: white;
    border-color: #ff85b3;
}

body.dark-mode .checkbox-item-50.checked {
    background: #ff4081;
}

.breast-option {
    border-color: #ec407a;
}

.breast-option.checked {
    background: #ec407a;
    border-color: #ec407a;
}

.bottle-option {
    border-color: #29b6f6;
}

.bottle-option.checked {
    background: #29b6f6;
    border-color: #29b6f6;
}

.poop-option {
    border-color: #8d6e63;
}

.poop-option.checked {
    background: #8d6e63;
    border-color: #8d6e63;
}

.pee-option {
    border-color: #42a5f5;
}

.pee-option.checked {
    background: #42a5f5;
    border-color: #42a5f5;
}

/* ========== BUTTONS ========== */
.big-button {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s;
    text-decoration: none !important;
}

.big-button:hover {
    background: linear-gradient(135deg, #45a049 0%, #1B5E20 100%);
    transform: translateY(-2px);
}

body.dark-mode .big-button {
    background: linear-gradient(135deg, #388e3c 0%, #1B5E20 100%);
}

body.dark-mode .big-button:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #145214 100%);
}

/* Cancel Edit Button */
#cancelEditBtn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    margin-top: 10px;
}

#cancelEditBtn:hover {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
}

body.dark-mode #cancelEditBtn {
    background: linear-gradient(135deg, #f44336 0%, #b71c1c 100%);
}

body.dark-mode #cancelEditBtn:hover {
    background: linear-gradient(135deg, #f44336 0%, #a41616 100%);
}

/* ========== TAB STYLES ========== */
.tabs {
    display: flex;
    gap: 5px;
    margin: 20px 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
}

body.dark-mode .tabs {
    border-bottom: 2px solid #444;
}

.tab {
    padding: 12px 24px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}

body.dark-mode .tab {
    background: #333;
    border-color: #555;
    color: #aaa;
}

.tab:hover {
    background: #e9ecef;
}

body.dark-mode .tab:hover {
    background: #444;
}

.tab.active {
    background: #ff85b3;
    color: white;
    border-color: #ff85b3;
    text-decoration: none !important;
    border-bottom: none !important;
}

body.dark-mode .tab.active {
    background: #ff4081;
    border-color: #ff4081;
    border-bottom: none !important;
}

/* Remove the line under active tabs */
.tab.active::after {
    content: none !important;
    height: 0 !important;
    background: transparent !important;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== STATISTICS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

body.dark-mode .stat-card {
    background: #2d2d2d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

body.dark-mode .stat-card h3 {
    color: #ff85b3;
}

.stat-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ffccd5;
}

body.dark-mode .stat-section {
    border-bottom-color: #333;
}

.stat-section h4 {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.dark-mode .stat-section h4 {
    color: #aaa;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

.stat-row span {
    color: #666;
    font-size: 14px;
}

body.dark-mode .stat-row span {
    color: #ccc;
}

.stat-row strong {
    color: #d81b60;
    font-size: 16px;
    font-weight: 700;
}

body.dark-mode .stat-row strong {
    color: #ff4081;
}

.baby-a-stat {
    border-left: 4px solid #ec407a;
}

.baby-b-stat {
    border-left: 4px solid #29b6f6;
}

/* ========== TABLE STYLES ========== */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s;
    overflow-x: auto;
}

body.dark-mode .table-container {
    background: #2d2d2d;
}

.table-toggle-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border-radius: 12px;
    border: 2px solid #ffe4ec;
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.08);
}

body.dark-mode .table-toggle-controls {
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.95) 0%, rgba(30, 30, 30, 0.95) 100%);
    border: 2px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.today-toggle-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.today-toggle-label {
    font-weight: 700;
    color: #555;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-mode .today-toggle-label {
    color: #ccc;
}

.today-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.3);
}

body.dark-mode .today-toggle-btn {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.today-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(108, 117, 125, 0.4);
}

body.dark-mode .today-toggle-btn:hover {
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.6);
}

.today-toggle-btn.active {
    background: linear-gradient(135deg, #ff80ab 0%, #f50057 100%);
    box-shadow: 0 3px 8px rgba(255, 133, 179, 0.4);
}

body.dark-mode .today-toggle-btn.active {
    background: linear-gradient(135deg, #ff4081 0%, #d81b60 100%);
    box-shadow: 0 3px 8px rgba(255, 64, 129, 0.6);
}

.today-toggle-btn i {
    font-size: 16px;
}

.today-count-badge {
    background: #ff85b3;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode .today-count-badge {
    background: #ff4081;
}

.table-info {
    font-weight: 600;
    color: #666;
    font-size: 15px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

body.dark-mode .table-info {
    color: #bbb;
    background: rgba(60, 60, 60, 0.7);
    border: 1px solid #555;
}

.table-controls {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-controls button {
    padding: 10px 15px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none !important;
}

.table-controls button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.export-btn {
    background: #2196F3;
}

.backup-btn {
    background: #ff9800;
}

.refresh-btn {
    background: #4CAF50;
}

.refresh-btn:hover {
    background: #45a049;
}

.import-btn {
    background: #673ab7;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: #ffe4ec;
    position: sticky;
    top: 0;
}

body.dark-mode thead {
    background: #252525;
}

th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #ad1457;
    border-bottom: 2px solid #ffccd5;
    white-space: nowrap;
}

body.dark-mode th {
    color: #ff85b3;
    border-bottom-color: #333;
}

td {
    padding: 12px;
    border-bottom: 1px solid #ffe4ec;
    color: #333;
    white-space: nowrap;
}

body.dark-mode td {
    color: #e0e0e0;
    border-bottom-color: #333;
}

tr:hover {
    background-color: #fff5f7;
}

body.dark-mode tr:hover {
    background-color: #2a2a2a;
}

/* Improved table row styling */
.baby-row-liana {
    background: linear-gradient(90deg, rgba(236, 64, 122, 0.1) 0%, rgba(236, 64, 122, 0.05) 2%, transparent 100%);
}

.baby-row-livia {
    background: linear-gradient(90deg, rgba(41, 182, 246, 0.1) 0%, rgba(41, 182, 246, 0.05) 2%, transparent 100%);
}

.baby-row-liana:hover {
    background: linear-gradient(90deg, rgba(236, 64, 122, 0.15) 0%, rgba(236, 64, 122, 0.08) 2%, rgba(236, 64, 122, 0.03) 100%);
}

.baby-row-livia:hover {
    background: linear-gradient(90deg, rgba(41, 182, 246, 0.15) 0%, rgba(41, 182, 246, 0.08) 2%, rgba(41, 182, 246, 0.03) 100%);
}

body.dark-mode .baby-row-liana {
    background: linear-gradient(90deg, rgba(236, 64, 122, 0.15) 0%, rgba(236, 64, 122, 0.08) 2%, #2d2d2d 100%);
}

body.dark-mode .baby-row-livia {
    background: linear-gradient(90deg, rgba(41, 182, 246, 0.15) 0%, rgba(41, 182, 246, 0.08) 2%, #2d2d2d 100%);
}

body.dark-mode .baby-row-liana:hover {
    background: linear-gradient(90deg, rgba(236, 64, 122, 0.2) 0%, rgba(236, 64, 122, 0.12) 2%, #333 100%);
}

body.dark-mode .baby-row-livia:hover {
    background: linear-gradient(90deg, rgba(41, 182, 246, 0.2) 0%, rgba(41, 182, 246, 0.12) 2%, #333 100%);
}

/* Baby name column styling */
.baby-name {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}

.baby-name-liana {
    color: #ec407a;
}

.baby-name-livia {
    color: #29b6f6;
}

.baby-icon {
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.baby-icon-liana {
    background: #ec407a;
    color: white;
}

.baby-icon-livia {
    background: #29b6f6;
    color: white;
}

/* Improved diaper status display */
.diaper-status {
    display: flex;
    gap: 8px;
    align-items: center;
}

.diaper-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.diaper-poop {
    background: #8d6e63;
    color: white;
}

.diaper-pee {
    background: #42a5f5;
    color: white;
}

.diaper-both {
    background: linear-gradient(135deg, #8d6e63 50%, #42a5f5 50%);
    color: white;
}

.diaper-none {
    background: #e0e0e0;
    color: #666;
    font-size: 12px;
}

body.dark-mode .diaper-none {
    background: #444;
    color: #aaa;
}

/* Feeding type styling */
.feeding-type {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.feeding-breast {
    background: rgba(236, 64, 122, 0.15);
    color: #ec407a;
    border: 1px solid rgba(236, 64, 122, 0.3);
}

.feeding-formula {
    background: rgba(41, 182, 246, 0.15);
    color: #29b6f6;
    border: 1px solid rgba(41, 182, 246, 0.3);
}

.feeding-both {
    background: linear-gradient(135deg, rgba(236, 64, 122, 0.15) 50%, rgba(41, 182, 246, 0.15) 50%);
    color: #673ab7;
    border: 1px solid rgba(107, 58, 183, 0.3);
}

.feeding-none {
    background: rgba(224, 224, 224, 0.3);
    color: #666;
    border: 1px solid rgba(224, 224, 224, 0.5);
}

body.dark-mode .feeding-none {
    background: rgba(68, 68, 68, 0.3);
    color: #aaa;
    border: 1px solid rgba(170, 170, 170, 0.3);
}

/* Amount styling */
.amount-display {
    font-weight: bold;
    color: #4CAF50;
    display: flex;
    align-items: center;
    gap: 5px;
}

body.dark-mode .amount-display {
    color: #81c784;
}

.amount-zero {
    color: #9e9e9e;
    font-weight: normal;
}

/* Notes styling */
.notes-display {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: #666;
}

body.dark-mode .notes-display {
    color: #aaa;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 3px;
    transition: all 0.3s;
    text-decoration: none !important;
}

.edit-btn {
    background: #2196F3;
    color: white;
}

.edit-btn:hover {
    background: #1976d2;
}

.delete-btn {
    background: #f44336;
    color: white;
}

.delete-btn:hover {
    background: #d32f2f;
}

/* Column widths */
#recordsTable th:nth-child(1) { width: 100px; } /* Baby */
#recordsTable th:nth-child(2) { width: 100px; } /* Date */
#recordsTable th:nth-child(3) { width: 80px; }  /* Time */
#recordsTable th:nth-child(4) { width: 120px; } /* Feeding */
#recordsTable th:nth-child(5) { width: 100px; } /* Amount */
#recordsTable th:nth-child(6) { width: 100px; } /* Diaper */
#recordsTable th:nth-child(7) { width: 150px; } /* Notes */
#recordsTable th:nth-child(8) { width: 120px; } /* Actions */

/* Table header improvements */
#recordsTable th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f5f5f5;
    border-bottom: 2px solid #ff85b3;
}

body.dark-mode #recordsTable th {
    background: #333;
    border-bottom: 2px solid #ff4081;
}

/* Time column styling */
.time-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #666;
}

body.dark-mode .time-display {
    color: #aaa;
}

/* Date column styling */
.date-display {
    font-weight: 600;
    color: #333;
}

body.dark-mode .date-display {
    color: #e0e0e0;
}

/* ========== PAGINATION STYLES ========== */
#paginationContainer > div {
    background: #f9f9f9;
    border-radius: 10px;
    margin-top: 20px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

body.dark-mode #paginationContainer > div {
    background: #333;
}

#paginationContainer .action-btn {
    background: #6c757d;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

#paginationContainer .action-btn:hover {
    background: #5a6268;
}

#paginationContainer select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

body.dark-mode #paginationContainer select {
    background: #444;
    border-color: #555;
    color: #e0e0e0;
}

#paginationContainer button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

#paginationContainer span {
    font-weight: bold;
    color: #555;
}

body.dark-mode #paginationContainer span {
    color: #aaa;
}

.pagination-nav-btn {
    padding: 8px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-nav-btn:hover:not(.pagination-nav-disabled) {
    background: #1976d2;
}

.pagination-nav-disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.pagination-info {
    font-weight: bold;
    color: #555;
    padding: 0 10px;
}

body.dark-mode .pagination-info {
    color: #aaa;
}

/* ========== MODAL STYLES ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

body.dark-mode .modal-content {
    background: #2d2d2d;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ff85b3;
}

.modal-header h3 {
    color: #d81b60;
    margin: 0;
}

body.dark-mode .modal-header h3 {
    color: #ff85b3;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #ff85b3;
}

.modal-body {
    margin: 20px 0;
}

.modal-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

body.dark-mode .modal-section {
    background: #333;
}

.modal-section h4 {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.dark-mode .modal-section h4 {
    color: #aaa;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.cancel-btn {
    background: #f5f5f5;
    color: #666;
}

body.dark-mode .cancel-btn {
    background: #444;
    color: #ccc;
}

.confirm-btn {
    background: #4CAF50;
    color: white;
}

.confirm-btn:hover {
    background: #45a049;
}

/* ========== CHART STYLES ========== */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body.dark-mode .chart-container {
    background: #2d2d2d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.chart-container h4 {
    color: #666;
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-mode .chart-container h4 {
    color: #ccc;
}

/* Chart tooltip improvements */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    border-radius: 8px !important;
    padding: 10px !important;
    color: white !important;
    border: none !important;
}

body.dark-mode .chartjs-tooltip {
    background: rgba(0, 0, 0, 0.9) !important;
    color: #e0e0e0 !important;
}

/* Better line chart animations */
.chartjs-render-monitor {
    animation: chartjs-render-animation 0.5s ease-out;
}

@keyframes chartjs-render-animation {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* ========== REPORTS TAB ========== */
.report-filters {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

body.dark-mode .filter-group label {
    color: #ccc;
}

.report-date {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: white;
}

body.dark-mode .report-date {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

.report-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

.report-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    max-width: 200px;
    width: 100%;
    justify-content: center;
}

.report-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.liana-btn {
    background: #ec407a;
}

.livia-btn {
    background: #29b6f6;
}

.custom-btn {
    background: #9c27b0;
}

.summary-btn {
    background: #ff9800;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    header {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-top: 10px;
    }
    
    .dark-mode-toggle {
        top: 10px;
        left: 10px;
        width: 35px;
        height: 35px;
    }
    
    .baby-tabs {
        flex-direction: column;
        padding: 15px;
    }
    
    .baby-tab {
        padding: 15px;
        font-size: 16px;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        border-radius: 5px;
        margin-bottom: 5px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-toggle-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .today-toggle-group {
        justify-content: center;
    }
    
    .table-info {
        text-align: center;
    }
    
    .table-controls {
        flex-direction: column;
    }
    
    .table-controls button {
        width: 100%;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    #paginationContainer > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    #paginationContainer > div > div:first-child,
    #paginationContainer > div > div:last-child {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Responsive table adjustments */
    #recordsTable th:nth-child(1),
    #recordsTable th:nth-child(2),
    #recordsTable th:nth-child(3),
    #recordsTable th:nth-child(4),
    #recordsTable th:nth-child(5),
    #recordsTable th:nth-child(6),
    #recordsTable th:nth-child(7),
    #recordsTable th:nth-child(8) {
        width: auto;
    }
    
    .baby-name {
        flex-direction: column;
        gap: 2px;
        align-items: flex-start;
    }
    
    .diaper-status {
        flex-direction: column;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    header {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .baby-tab {
        padding: 12px;
        font-size: 15px;
    }
    
    .today-toggle-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .today-toggle-label {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 6px;
        font-size: 14px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 3px;
    }
    
    .edit-btn, .delete-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    #paginationContainer select {
        width: 100%;
    }
}

/* ========== FIXES FOR UNDERLINES ========== */
/* Remove all text decoration and focus outlines */
button, 
.btn, 
.baby-tab, 
.tab, 
.action-btn,
[onclick],
.baby-name {
    text-decoration: none !important;
}

.baby-name:focus,
.baby-tab:focus,
.tab:focus,
.action-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(255, 133, 179, 0.3) !important;
}

/* Force remove any borders that might look like lines */
.baby-tab,
.baby-tab.active,
.tab,
.tab.active {
    border-bottom: none !important;
    border-bottom-width: 0 !important;
    border-bottom-style: none !important;
    border-bottom-color: transparent !important;
}

/* Analytics Chart Styles */
.chart-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    margin-bottom: 20px;
}

body.dark-mode .chart-card {
    background: #2d2d2d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.chart-card h4 {
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-mode .chart-card h4 {
    color: #ccc;
}

/* Remove any leftover PWA styles */
.offline-indicator, .install-button {
    display: none !important;
}

/* Fix for analytics tab layout */
#analytics-tab .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Chart container for analytics */
.charts-container {
    grid-column: 1 / -1;
    margin-top: 30px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}