/* GoToJail Standalone Timesheet CSS Design Tokens */

:root {
    --bg-dark: #030712;
    --bg-panel: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Category Colors */
    --pcso-color: #3b82f6;
    --pcso-bg: rgba(59, 130, 246, 0.12);
    --pcso-border: rgba(59, 130, 246, 0.3);
    
    --hcso-color: #f59e0b;
    --hcso-bg: rgba(245, 158, 11, 0.12);
    --hcso-border: rgba(245, 158, 11, 0.3);
    
    --backup-color: #10b981;
    --backup-bg: rgba(16, 185, 129, 0.12);
    --backup-border: rgba(16, 185, 129, 0.3);
    
    --custom-color: #8b5cf6;
    --custom-bg: rgba(139, 92, 246, 0.12);
    --custom-border: rgba(139, 92, 246, 0.3);
    
    --glass-blur: blur(12px);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    height: 100vh;
}

/* Overall Grid Layout */
.scheduler-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar-panel {
    background: rgba(10, 15, 30, 0.8);
    border-right: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.sidebar-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: #38bdf8;
}

.logo-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title-row h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.btn-icon-add {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.btn-icon-add:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--border-hover);
}

.section-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

/* Template Catalog Cards */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: grab;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

.template-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.template-card:active {
    cursor: grabbing;
}

.template-card.dragging {
    opacity: 0.4;
    border-style: dashed;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.badge-category {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.badge-pcso {
    background: var(--pcso-bg);
    border-color: var(--pcso-border);
    color: #93c5fd;
}

.badge-hcso {
    background: var(--hcso-bg);
    border-color: var(--hcso-border);
    color: #fde68a;
}

.badge-backup {
    background: var(--backup-bg);
    border-color: var(--backup-border);
    color: #a7f3d0;
}

.badge-custom {
    background: var(--custom-bg);
    border-color: var(--custom-border);
    color: #ddd6fe;
}

.template-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.template-card:hover .template-actions {
    opacity: 1;
}

.btn-action-small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px;
    border-radius: 4px;
}

.btn-action-small:hover {
    background: rgba(255, 255, 255, 0.1);
}

.template-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px 0;
}

.template-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.template-cmd {
    font-family: monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 4px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timesheet Grid Panel */
.timesheet-panel {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: hidden;
    background: radial-gradient(circle at top right, rgba(16, 24, 48, 0.3) 0%, var(--bg-dark) 80%);
}

.timesheet-header {
    position: relative;
    z-index: 100;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 7, 18, 0.4);
    backdrop-filter: var(--glass-blur);
}

.header-titles h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.header-titles p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

.timezone-badge {
    font-family: monospace;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
}

/* Scrollable grid contents */
.timesheet-grid {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Grid Headers */
.grid-header-row {
    display: grid;
    grid-template-columns: 100px repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 10;
}

.col-time-header {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.col-slot-header {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Hour Grid Row */
.hour-row {
    display: grid;
    grid-template-columns: 100px repeat(4, 1fr);
    gap: 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
    min-height: 80px;
    align-items: stretch;
}

.hour-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 12px;
}

.hour-label .time-num {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.hour-label .time-ampm {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* Time Slot Dropzone */
.time-slot {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 8px;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 64px;
}

.time-slot:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.time-slot.drag-over {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.1);
}

.slot-bg-label {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.03);
    font-weight: 800;
    pointer-events: none;
    transition: color 0.2s;
}

.time-slot:hover .slot-bg-label {
    color: rgba(255, 255, 255, 0.08);
}

/* Scheduled Job Cards Container */
.slot-cards-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    z-index: 2;
}

/* Job Cards Placed on Grid */
.job-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--border-color);
    border-left: 3px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    cursor: grab;
    user-select: none;
    transition: all 0.2s;
}

.job-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--border-hover);
}

.job-card:active {
    cursor: grabbing;
}

.job-card.dragging {
    opacity: 0.3;
}

.job-card.border-pcso { border-left-color: var(--pcso-color); }
.job-card.border-hcso { border-left-color: var(--hcso-color); }
.job-card.border-backup { border-left-color: var(--backup-color); }
.job-card.border-custom { border-left-color: var(--custom-color); }

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.badge-category-mini {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}

.btn-card-cog {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    color: var(--text-secondary);
    transition: color 0.2s, transform 0.2s;
}

.btn-card-cog:hover {
    color: #fff;
    transform: rotate(45deg);
}

.job-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-card-days {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Modals Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none; /* toggled via JS */
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 460px;
    max-width: 90%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #fff;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Radio Frequencies & custom checkboxes */
.frequency-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.days-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.check-day-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Time adjustment selectors */
.time-adjustment-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Job Meta Header inside Settings Modal */
.job-meta-summary {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
}

.job-meta-summary h4 {
    margin: 8px 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.job-meta-summary p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.job-meta-summary code {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    display: block;
    word-break: break-all;
}

/* Modal Actions Buttons */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
}

.btn-primary {
    background: #0284c7;
    border: 1px solid #0369a1;
    color: #fff;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0369a1;
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #ef4444;
    color: #fff;
}

/* Flash alerts formatting */
.flash-messages {
    padding: 0 24px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash-alert {
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 0.85rem;
    position: relative;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-family: monospace;
    white-space: pre-wrap;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fde68a;
}

.alert-icon {
    font-size: 1.1rem;
    margin-right: 12px;
    font-weight: 700;
}

.alert-content {
    flex-grow: 1;
    line-height: 1.4;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
}

.alert-close:hover {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 32px 16px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 0.85rem;
    margin: 0 0 12px 0;
}

.btn-add-primary {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-add-primary:hover {
    background: #38bdf8;
    color: #000;
}

/* Unified App Switcher Dropdown */
.app-switcher-dropdown {
    position: relative;
    display: inline-block;
}

.btn-sentinel {
    font-family: var(--font-heading);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.app-switcher-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    background: rgba(8, 12, 24, 0.95);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 12px;
    z-index: 1000;
}

.app-switcher-content::before {
    content: '';
    position: absolute;
    top: -16px;
    left: -10px;
    right: -10px;
    height: 20px;
    background: transparent;
}

.app-switcher-dropdown:hover .app-switcher-content {
    display: block;
}

.switcher-header {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 8px 8px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.switcher-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: 4px;
}

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

.switcher-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.switcher-item.active {
    background: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    cursor: default;
    opacity: 0.6;
}

.switcher-indicator {
    width: 6px;
    height: 36px;
    border-radius: 3px;
    flex-shrink: 0;
}

.indicator-pcso { background-color: var(--pcso-color); }
.indicator-hcso { background-color: var(--hcso-color); }
.indicator-scheduler { background-color: #10b981; }

.switcher-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.switcher-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.switcher-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.app-switcher-dropdown:hover .switcher-arrow {
    transform: rotate(180deg);
}

