/* style.css */
/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --danger-color: #dc3545;
    --success-color: #28a745;
}

[data-theme="dark"] {
    --primary-color: #4da3ff;
    --border-color: #495057;
    --card-bg: #343a40;
    --text-color: #f8f9fa;
    --text-muted: #adb5bd;
    --danger-color: #ff6b6b;
    --success-color: #00c851;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f8f9fa;
    color: #212529;
}

[data-theme="dark"] body {
    background: #212529;
    color: #f8f9fa;
}

/* Navigation */
nav {
    background: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

[data-theme="dark"] nav {
    background: #2d2d2d;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(0,123,255,0.1);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin: 1rem auto;
    max-width: 1460px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

input, select, textarea {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Modern Buttons */
.btn {
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0062cc);
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333);
    color: white;
}

.btn-secondary {
    background: #f8f9fa;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.05);
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
}

/* Comments Section */
.comments-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.comment-card {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comment-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.comment-actions {
    display: flex;
    gap: 0.8rem;
}

/* Attachments styling */
.attachments-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    max-width: 300px;
}

.attachment-thumb {
    max-width: 60px;
    max-height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.file-icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-color);
    word-break: break-all;
}

.file-name:hover {
    color: var(--primary-color);
}

.comment-input-group {
    margin-bottom: 1rem;
}

.comment-input-group input[type="file"] {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
}

/* Timer Section */
.timer-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.timer-group {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.timer-group input[type="datetime-local"] {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

/* Form Actions */
.form-actions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.data-table th,
.data-table td {
    padding: 1.2rem;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background-color: var(--card-bg);
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-badge.open { background: #d4edda; color: #155724; }
.status-badge.paused { background: #fff3cd; color: #856404; }
.status-badge.finished { background: #d1ecf1; color: #0c5460; }

[data-theme="dark"] .status-badge.open { background: #2d4a35; color: #c3e6cb; }
[data-theme="dark"] .status-badge.paused { background: #4a3f2d; color: #ffeeba; }
[data-theme="dark"] .status-badge.finished { background: #2d4a4a; color: #bee5eb; }
[data-theme="dark"] .report-section { background: #2d2d2d; color: #ffffff; }
[data-theme="dark"] .chart-container { background: #d3d3d3; color: #ffffff; }
[data-theme="dark"] .top-rank { background: #3d3d3d; color: #ffffff; }
[data-theme="dark"] .consumer-item { background: #3d3d3d; color: #ffffff; }


/* Alternating row colors */
.data-table tr.even {
    background-color: rgba(0, 0, 0, 0.01);
}


[data-theme="dark"] .data-table tr.even {
    background-color: rgba(0, 0, 0, 0.09);
}

/* PDF export fixes */
#pdf-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 20px;
    border-radius: 12px;
}

.data-table th,
.data-table td {
    background-color: inherit !important;
    color: inherit !important;
}

.wide-table {
    overflow-x: auto;
}

.col-customer { min-width: 150px; }
.col-desc { min-width: 270px; }
.col-assignee { min-width: 90px; }
.col-worktime, .col-pausetime { min-width: 120px; }
.col-status { width: 90px; min-width: 100px; max-width: 100px; }
.col-actions { min-width: 180px; }
.col-id { min-width: 8px; }

.description-cell {
    max-width: 400px;
    word-wrap: break-word;
}

.todo-item:hover {
    background: rgba(0,0,0,0.03);
}

[data-theme="dark"] .todo-item:hover {
    background: rgba(255,255,255,0.03);
}

.btn-icon {
    padding: 0.5rem;
    min-width: auto;
    line-height: 1;
}

.btn-icon svg {
    vertical-align: middle;
    display: block;
}


#task-input {
    font-family: inherit;
    font-size: 1rem;
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--primary-color);
}

.nav-icon-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    transform: rotate(45deg);
}

.nav-icon-btn svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Notifications */
.notification-container {
    position: relative;
    display: inline-block;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 10px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Add to existing nav-icon-btn styles */
.nav-icon-btn {
    position: relative;
}

/* Notification Modal */
.notification-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
}

.notification-modal.active {
    display: block;
}

.modal-content {
    background: var(--card-bg);
    width: 400px;
    max-width: 90%;
    position: fixed;
    top: 70px;
    right: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.close-modal {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

.modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
}

[data-theme="dark"] .notification-item {
    background: rgba(255,255,255,0.05);
}

.notification-icon svg {
    width: 20px;
    height: 20px;
    margin-top: 3px;
}

.notification-details {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--primary-color);
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
}

.notification-description {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.4;
}

.no-notifications {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Filters */
.filters-container {
    margin: 1rem 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
}

.filter-form {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

/* Sortable headers */
.data-table th a {
    color: inherit;
    text-decoration: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.data-table th a:hover {
    color: var(--primary-color);
}

/* Alternating rows */
.data-table tr.odd {
    background-color: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .data-table tr.odd {
    background-color: rgba(255, 255, 255, 0.03);
}

.col-createdate {
    width: 140px;
    min-width: 140px;
}

/* If using mobile responsiveness */
@media (max-width: 768px) {
    .col-createdate {
        width: 120px;
        min-width: 120px;
    }
}

/* Nav logo */
.nav-logo img.company-logo {
    height: 40px;
    width: auto;
    margin-right: 1rem;
    border-radius: 4px;
}

/* System options logo styling */
.logo-upload-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.logo-preview {
    max-height: 100px;
    width: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px;
}

.remove-logo-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.remove-logo-check input[type="checkbox"] {
    margin-right: 0.5rem;
}
