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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --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);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 2rem 1rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--surface-color);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.card {
    padding: 2.5rem;
    border-right: 1px solid var(--border-color);
}

.card:last-child {
    border-right: none;
}

.card-full {
    grid-column: 1 / -1;
    padding: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.card-header {
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

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

.form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

input[type="text"],
input[type="time"],
input[type="number"],
input[type="month"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
input[type="month"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

#shiftsContainer input[type="text"] {
    min-width: 100px;
    width: 100px;
    max-width: 100%;
    font-size: 1em;
    padding: 4px 8px;
    height: 50px;
}

#shiftsContainer input[type="time"] {
    min-width: 100px;
    width: 100px;
    max-width: 100%;
    font-size: 1em;
    padding: 4px 8px;
    height: 50px;
}
#shiftsContainer input[type="number"] {
    min-width: 80px;
    width: 80px;
    max-width: 100%;
    font-size: 1em;
    padding: 4px 8px;
    height: 50px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem;
    min-width: 36px;
    height: 36px;
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: scale(1.05);
}

.btn-generate {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    margin-top: 1rem;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.worker-list {
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
}

.worker-list:empty::before {
    content: "No workers added yet. Add your first worker above.";
    color: var(--text-secondary);
    font-style: italic;
    display: block;
    text-align: center;
    padding: 2rem;
}

.worker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.worker-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.worker-item:last-child {
    margin-bottom: 0;
}

.worker-name {
    font-weight: 500;
    color: var(--text-primary);
}

.shift-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
}

.shift-selector label {
    margin-bottom: 0;
    font-weight: 600;
}

.shift-selector select {
    width: auto;
    min-width: 80px;
}

.shifts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.shift-card {
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.shift-card:hover {
    border-color: var(--primary-color);
}

.shift-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.shift-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: end;
    min-width: 120px;   
}

.month-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.month-section label {
    margin-bottom: 0;
    font-weight: 600;
    white-space: nowrap;
}

.month-section input {
    flex: 1;
    max-width: 200px;
}

.schedule-output {
    margin-top: 2rem;
}

.schedule-header {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: white;
}

#tableSchedule {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#tableSchedule th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 1rem 0.75rem;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

#tableSchedule th:first-child {
    text-align: left;
    min-width: 120px;
}

#tableSchedule td {
    padding: 0.875rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

#tableSchedule td:first-child {
    text-align:center;
    font-weight: 600;
    background: #f8fafc;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 1px solid var(--border-color);
}

#tableSchedule tr:hover td {
    background: #f1f5f9;
}

#tableSchedule th, #tableSchedule td {
    min-width: 120px;
    max-width: 48px;
    width: 48px;
    text-align: center;
    padding: 4px 2px;
    height: 28px;
    vertical-align: middle;
    font-size: 0.95em;
}

.off {
     background-color: #ef4444 !important; 
    color: #fff !important;
    font-weight: bold;
    border: 2px solid #b91c1c;
}


.night {
    background: #1e293b !important;
    color: white !important;
    font-weight: 500;
}
.afternoon {
    background: #3b82f6 !important;
    color: white !important;
    font-weight: 500;
}
.export{
    margin-top: 1rem;
    background: white;
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
    display: flex;
    margin-left: auto;
    margin-right: auto;
    gap: 0.5rem;
}
.export svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
    margin-right: 0.5rem;
}
.export:hover {
    background: var(--primary-light);
    color: var(--primary-hover);
    border-color: var(--primary-hover);
}
.worker-list::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.worker-list::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.worker-list::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.worker-list::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.shift-morning {
    background: #fde68a !important; 
    color: #92400e !important;
    font-weight: 500;
}
.shift-afternoon {
    background: #cdba70 !important; 
    color: #92400e !important;
    font-weight: 500;
}
.shift-night {
    background: #90834f !important; 
    color: #fbfbfb !important;
    font-weight: 500;
}

