/* Time Tracker - Modern Business Style inspired by Avallo Tools */

/* Font imports with fallbacks */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-red: #dc2626;
    --primary-red-dark: #b91c1c;
    --primary-red-light: #ef4444;
    --secondary-red: #991b1b;
    --accent-red: #fee2e2;
    
    --primary-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --red-gradient-light: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    --dark-gradient: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    
    /* Lepszy kontrast dla tekstu */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    
    /* Białe tło */
    --bg-primary: #ffffff;
    --bg-secondary: #ffffff;
    --bg-light: #f8fafc;
    --bg-hover: #f1f5f9;
    
    --border-color: #d1d5db;
    --border-light: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font stack with extensive fallbacks */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    
    /* Mobile-first sizing */
    --base-font-size: 14px;
    --mobile-padding: 1rem;
    --desktop-padding: 2rem;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--base-font-size);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
    overflow-x: hidden;
}

/* Typography - Mobile First */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

h1 { font-size: 1.75rem; color: var(--text-primary); }
h2 { font-size: 1.5rem; color: var(--text-primary); }
h3 { font-size: 1.25rem; color: var(--text-primary); }
h4 { font-size: 1.125rem; color: var(--text-primary); }
h5 { font-size: 1rem; color: var(--text-primary); }
h6 { font-size: 0.875rem; color: var(--text-primary); }

/* Navigation - Mobile First */
.navbar {
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    color: var(--primary-red) !important;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.navbar-brand i {
    font-size: 1.5rem;
    color: var(--primary-red);
}

.navbar-brand::before {
    content: "🏢";
    font-size: 1.5rem;
    margin-right: 0.25rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
}

.nav-link:hover {
    color: var(--primary-red) !important;
    background: var(--accent-red);
}

.nav-link.active {
    color: var(--primary-red) !important;
    background: var(--accent-red);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Container - Mobile First */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--mobile-padding);
}

/* Cards - Mobile Optimized */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--bg-primary);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.card-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.card-body {
    padding: var(--mobile-padding);
    background: var(--bg-primary);
}

/* Buttons - Touch Friendly */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px; /* Touch-friendly minimum */
    min-width: 44px;
    text-align: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, var(--secondary-red) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, var(--secondary-red) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    color: white;
}

.btn-danger {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, var(--secondary-red) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
    background: transparent;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 52px;
}

/* Forms - Touch Optimized z lepszym kontrastem */
.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 44px; /* Touch-friendly */
    font-family: var(--font-family);
    font-weight: 500;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    background: var(--bg-primary);
    outline: none;
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: block;
}

.input-group {
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.input-group-text {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-right: none;
    padding: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-red);
    background: rgba(220, 38, 38, 0.05);
    color: var(--primary-red);
}

/* Alerts - Mobile Optimized */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    position: relative;
    border-left: 4px solid;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border-left-color: #22c55e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
    border-left-color: #3b82f6;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-left-color: #f59e0b;
}

/* Flash Messages - Mobile Optimized */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    z-index: 1050;
    max-width: none;
}

.flash-messages .alert {
    margin-bottom: 0.5rem;
    animation: slideInDown 0.3s ease-out;
    box-shadow: var(--shadow-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

/* Calendar Styles - Mobile Optimized */
.fc {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    font-family: var(--font-family);
    font-size: 0.875rem;
}

.fc .fc-toolbar {
    flex-direction: column;
    gap: 0.75rem;
}

.fc .fc-toolbar-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 700;
    order: -1;
}

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

.fc .fc-button-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.75rem;
    min-height: 36px;
    font-family: var(--font-family);
    color: white;
}

.fc .fc-button-primary:hover {
    background: linear-gradient(135deg, var(--primary-red-dark) 0%, var(--secondary-red) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.fc .fc-button-primary:disabled {
    background: var(--text-muted);
    opacity: 0.6;
    transform: none;
    box-shadow: none;
    color: white;
}

.fc .fc-daygrid-day.fc-day-today {
    background: rgba(220, 38, 38, 0.05) !important;
}

.fc .fc-daygrid-day-number {
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.25rem;
    font-size: 0.875rem;
}

.fc-day-today .fc-daygrid-day-number {
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.25rem;
}

.fc .fc-daygrid-event {
    border-radius: var(--border-radius);
    padding: 2px 4px;
    margin: 1px 0;
    font-weight: 500;
    border: none;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.7rem;
    font-family: var(--font-family);
    color: white;
}

.fc .fc-daygrid-event:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.fc-event.event-foreign {
    background: var(--primary-gradient) !important;
    color: white !important;
}

.fc-event.event-domestic {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

.fc-event.event-local {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: white !important;
}

.fc .fc-daygrid-day-frame {
    min-height: 60px;
}

/* Modal Styles - Mobile Optimized z lepszym kontrastem */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    margin: 1rem;
    background: var(--bg-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    background: var(--bg-light);
}

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

.modal-body {
    padding: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    background: var(--bg-light);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-footer .btn {
    flex: 1;
    min-width: 120px;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: var(--border-radius);
    background-color: var(--bg-light);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(220, 38, 38, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-red);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-red { color: var(--primary-red) !important; }

.bg-light { background: var(--bg-light) !important; }
.bg-primary { background: var(--bg-primary) !important; }
.bg-secondary { background: var(--bg-primary) !important; }

.border { border: 1px solid var(--border-color) !important; }
.border-0 { border: none !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.rounded-xl { border-radius: var(--border-radius-xl) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.hover-lift:hover {
    transform: translateY(-2px);
    transition: var(--transition);
}

/* Stats Cards */
.stats-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
}

.stats-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stats-card .rounded-circle {
    transition: var(--transition);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.5rem;
}

.stats-card:hover .rounded-circle {
    transform: scale(1.1);
}

/* Login Page - Mobile Optimized */
.login-container {
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--mobile-padding);
}

.login-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    color: var(--primary-red);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

.login-logo::before {
    content: "🏢";
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

/* Tables - Mobile Optimized */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table th {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem;
    white-space: nowrap;
}

.table td {
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem;
    color: var(--text-primary);
    vertical-align: middle;
}

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

/* Dashboard specific styles */
.dashboard-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
}

.dashboard-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.5rem 0 0 0;
}

/* Grid System - Mobile First */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col, .col-12, .col-md-6, .col-lg-4, .col-lg-6, .col-lg-8 {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

.col-12 { flex: 0 0 100%; }

/* Select2 styling dla lepszej widoczności */
.select2-container--default .select2-selection--single {
    background-color: var(--bg-primary) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    height: 44px !important;
    line-height: 40px !important;
    color: var(--text-primary) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    padding-left: 12px !important;
    font-weight: 500 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
}

.select2-dropdown {
    background-color: var(--bg-primary) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-lg) !important;
}

.select2-container--default .select2-results__option {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    padding: 8px 12px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--accent-red) !important;
    color: var(--primary-red) !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--primary-red) !important;
    color: white !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    padding: 8px !important;
}

/* Responsive Design - Tablet and Desktop */
@media (min-width: 768px) {
    :root {
        --base-font-size: 16px;
    }
    
    html {
        font-size: var(--base-font-size);
    }
    
    .container {
        max-width: 1200px;
        padding: 0 var(--desktop-padding);
    }
    
    .navbar {
        padding: 1rem 0;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .navbar-brand::before {
        font-size: 2rem;
        margin-right: 0.5rem;
    }
    
    .card-header {
        padding: 1.5rem;
        font-size: 1.125rem;
    }
    
    .card-body {
        padding: var(--desktop-padding);
    }
    
    .fc {
        padding: var(--desktop-padding);
    }
    
    .fc .fc-toolbar {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1.5rem;
        order: 0;
    }
    
    .fc .fc-button-primary {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        min-height: 40px;
    }
    
    .fc .fc-daygrid-day-frame {
        min-height: 80px;
    }
    
    .fc .fc-daygrid-event {
        font-size: 0.75rem;
        padding: 4px 8px;
        margin: 2px 0;
    }
    
    .fc .fc-daygrid-day-number {
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .fc-day-today .fc-daygrid-day-number {
        width: 30px;
        height: 30px;
        margin: 0.5rem;
    }
    
    .flash-messages {
        right: 20px;
        left: auto;
        max-width: 400px;
    }
    
    .modal-content {
        margin: 1.75rem auto;
    }
    
    .modal-footer .btn {
        flex: none;
        min-width: auto;
    }
    
    .login-card {
        padding: 3rem;
    }
    
    .login-logo h1 {
        font-size: 2rem;
    }
    
    .stats-card {
        padding: 1.5rem;
    }
    
    .stats-card .rounded-circle {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }
    
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.875rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    .col-md-6 { flex: 0 0 50%; }
    .col-lg-4 { flex: 0 0 33.333333%; }
    .col-lg-6 { flex: 0 0 50%; }
    .col-lg-8 { flex: 0 0 66.666667%; }
}

@media (min-width: 1024px) {
    .modal-lg {
        max-width: 800px;
    }
    
    .container {
        max-width: 1200px;
    }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .fc .fc-button-primary,
    .btn {
        text-rendering: optimizeLegibility;
    }
}

/* Print styles */
@media print {
    .navbar,
    .modal,
    .flash-messages,
    .btn {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
        color: black;
    }
} 