/* TimeSheet Pro v3 - Complete Styling */

:root {
    --primary: #14b8a6;
    --primary-dark: #0d9488;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--light);
    color: #1e293b;
    line-height: 1.6;
}

body.dark {
    background-color: #0f172a;
    color: #f1f5f9;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
    font-family: inherit;
    background-color: #ffffff;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

body.dark input[type="text"],
body.dark input[type="email"],
body.dark input[type="number"],
body.dark input[type="date"],
body.dark input[type="time"],
body.dark input[type="tel"],
body.dark select,
body.dark textarea {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
    outline: none;
}

input:invalid:focus,
select:invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--primary);
}

/* Buttons */
button {
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.dark .card {
    background: #1e293b;
    border-color: #334155;
}

/* Modal/Dialog Styles */
.modal-backdrop {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
    }
    to { 
        opacity: 1;
    }
}

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

.modal-content {
    animation: slideUp 0.3s ease;
}

/* Notification Toast */
.notification {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%) translateY(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

.notification.success {
    background-color: var(--success);
}

.notification.error {
    background-color: var(--danger);
}

.notification.warning {
    background-color: var(--warning);
}

.notification.info {
    background-color: #3b82f6;
}

/* Loading Spinner */
@keyframes spin {
    to { 
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Table Styling */
table {
    border-collapse: collapse;
    width: 100%;
}

thead th {
    background-color: #f8fafc;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

body.dark thead th {
    background-color: #0f172a;
    border-color: #334155;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

body.dark tbody td {
    border-color: #334155;
}

tbody tr:hover {
    background-color: #f8fafc;
}

body.dark tbody tr:hover {
    background-color: #1e293b;
}

/* Charts Container */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-teal {
    background-color: #ccf7f1;
    color: #0d9488;
}

.badge-gray {
    background-color: #e2e8f0;
    color: #64748b;
}

.badge-green {
    background-color: #d1fae5;
    color: #059669;
}

.badge-red {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .grid-cols-3 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .grid-cols-1 {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85rem;
    }

    thead th,
    tbody td {
        padding: 8px 12px;
    }

    h1 {
        font-size: 1.875rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.125rem;
    }
}

/* Print Styles */
@media print {
    nav,
    button,
    #time-entry-form,
    #task-manage-form {
        display: none;
    }

    .bg-gray-50,
    .border {
        border: 1px solid #000;
    }

    body {
        background: white;
    }
}

/* Utility Classes */
.text-overflow {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.transition-all {
    transition: all 0.2s ease;
}

/* Error State */
.error {
    color: var(--danger);
    border-color: var(--danger) !important;
}

.error-text {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 4px;
    display: block;
}

/* Success State */
.success {
    border-color: var(--success) !important;
    background-color: #f0fdf4;
}

/* Text Utilities */
.text-primary { 
    color: var(--primary); 
}

.text-secondary { 
    color: var(--secondary); 
}

.text-danger { 
    color: var(--danger); 
}

.text-success { 
    color: var(--success); 
}

.font-weight-light { 
    font-weight: 300; 
}

.font-weight-normal { 
    font-weight: 400; 
}

.font-weight-medium { 
    font-weight: 500; 
}

.font-weight-semibold { 
    font-weight: 600; 
}

.font-weight-bold { 
    font-weight: 700; 
}

/* Navigation Active State */
nav button.active {
    background-color: var(--primary) !important;
    color: white !important;
}

/* View Transitions */
.view {
    animation: fadeIn 0.3s ease;
}

/* Grid Gaps */
.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Spacing */
.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

/* Borders */
.border {
    border: 1px solid var(--border);
}

.border-t {
    border-top: 1px solid var(--border);
}

.border-b {
    border-bottom: 1px solid var(--border);
}

.border-l {
    border-left: 1px solid var(--border);
}

.border-r {
    border-right: 1px solid var(--border);
}

.rounded {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

/* Display */
.hidden {
    display: none !important;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.inline-flex {
    display: inline-flex;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

/* Flex Utilities */
.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.flex-1 {
    flex: 1;
}

/* Colors */
.bg-white {
    background-color: white;
}

.bg-gray-50 {
    background-color: #f8fafc;
}

.bg-gray-100 {
    background-color: #f1f5f9;
}

.bg-gray-200 {
    background-color: #e2e8f0;
}

.bg-gray-300 {
    background-color: #cbd5e1;
}

.bg-teal-600 {
    background-color: var(--primary);
}

.bg-teal-700 {
    background-color: var(--primary-dark);
}

.bg-blue-600 {
    background-color: #2563eb;
}

.bg-blue-700 {
    background-color: #1d4ed8;
}

.bg-red-600 {
    background-color: var(--danger);
}

.bg-red-100 {
    background-color: #fee2e2;
}

.bg-red-200 {
    background-color: #fecaca;
}

.text-white {
    color: white;
}

.text-gray-600 {
    color: #475569;
}

.text-gray-700 {
    color: #334155;
}

.text-gray-900 {
    color: #0f172a;
}

.text-teal-600 {
    color: var(--primary);
}

.text-blue-600 {
    color: #2563eb;
}

.text-red-600 {
    color: var(--danger);
}

/* Hover States */
.hover\:bg-gray-100:hover {
    background-color: #f1f5f9;
}

.hover\:bg-gray-300:hover {
    background-color: #cbd5e1;
}

.hover\:bg-gray-400:hover {
    background-color: #94a3b8;
}

.hover\:bg-teal-700:hover {
    background-color: var(--primary-dark);
}

.hover\:bg-blue-700:hover {
    background-color: #1d4ed8;
}

.hover\:bg-red-700:hover {
    background-color: #b91c1c;
}

.hover\:bg-red-200:hover {
    background-color: #fecaca;
}

.hover\:text-gray-700:hover {
    color: #334155;
}

.hover\:text-teal-600:hover {
    color: var(--primary);
}

.hover\:text-blue-700:hover {
    color: #1d4ed8;
}

.hover\:text-red-700:hover {
    color: #b91c1c;
}

/* Text Sizes */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

/* Font Weight */
.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Z-index */
.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}

/* Opacity */
.opacity-0 {
    opacity: 0;
}

.opacity-1 {
    opacity: 1;
}

/* Pointer Events */
.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* Dark Mode */
body.dark {
    color: #f1f5f9;
}

body.dark nav {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark .bg-white {
    background-color: #1e293b;
    color: #f1f5f9;
}

body.dark .text-gray-900 {
    color: #f1f5f9;
}

body.dark .text-gray-600 {
    color: #cbd5e1;
}

body.dark .border {
    border-color: #334155;
}
