/* CSS Variables for Theme Support */
:root {
    --banner-color: #6f42c1;
    --bg-color: #f5f5f5;
    --large-text-color: #333;
    --normal-text-color: #333;
    --title-color: #ffffff;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--normal-text-color);
    line-height: 1.6;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo-container {
    width: 800px; /* 4x larger */
    height: 320px; /* 4x larger */
}

.logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.date-time-container {
    text-align: right;
}

.date-display, .time-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--large-text-color);
}

.time-display {
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

/* Landing Page */
.landing-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 2rem;
}

.landing-buttons {
    display: grid;
    gap: 1rem;
    text-align: center;
}

.landing-btn {
    background: white;
    color: var(--normal-text-color);
    border: 2px solid #ddd;
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
}

.landing-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-backoffice {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-backoffice:hover {
    background: #218838;
}

.btn-jobscreen {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.btn-jobscreen:hover {
    background: #138496;
}

.terminal-selector {
    position: relative;
}

.terminal-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.terminal-dropdown.show {
    display: block;
}

.terminal-option {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    background: white;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.terminal-option:hover {
    background: #f8f9fa;
}

.terminal-option:last-child {
    border-bottom: none;
}

/* Terminal Styles */
.terminal-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.terminal-time {
    font-size: 1.1rem;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}

.btn-logout:hover {
    background: #c82333;
}

.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.login-form input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.job-screen {
    padding: 2rem;
}

.job-list {
    display: grid;
    gap: 1rem;
}

.job-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.job-header h3 {
    margin: 0;
    color: var(--large-text-color);
}

.priority-badge {
    background: #ffc107;
    color: #212529;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.job-details {
    margin-bottom: 1rem;
}

.job-details p {
    margin: 0.5rem 0;
    color: var(--normal-text-color);
}

.status-new { color: #6c757d; }
.status-in_progress { color: #007bff; }
.status-completed { color: #28a745; }
.status-cancelled { color: #dc3545; }

.job-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.job-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-start { background: #28a745; color: white; }
.btn-stop { background: #ffc107; color: #212529; }
.btn-complete { background: #17a2b8; color: white; }
.btn-cancel { background: #dc3545; color: white; }
.btn-note { background: #6f42c1; color: white; }
.btn-transfer { background: #fd7e14; color: white; }
.btn-flag { background: #ffc107; color: #212529; }
.btn-unflag { background: #6f42c1; color: white; }

.job-actions button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.job-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Keyboard */
.keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333;
    padding: 1rem;
    z-index: 10000;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.keyboard-row:last-child {
    margin-bottom: 0;
}

.key {
    flex: 1;
    min-width: 40px;
    height: 50px;
    background: #666;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.key:hover {
    background: #777;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Job Dashboard */
.jobscreen-header {
    background: #343a40;
    color: var(--title-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jobscreen-main {
    padding: 2rem;
}

.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.jobscreen-card {
    border-left: 4px solid #28a745;
}

.jobscreen-card.currently-working {
    border-left: 4px solid #007bff;
    animation: blinkBorder 2s infinite;
}

@keyframes blinkBorder {
    0%, 100% { border-left-color: #007bff; }
    50% { border-left-color: #28a745; }
}

.job-content {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 0.5rem;
}

.job-line1, .job-line2, .job-line3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.job-line3 span {
    font-size: 0.9rem;
    color: #666;
}

.due-date.overdue {
    color: #dc3545;
    font-weight: bold;
}

.due-date.due-soon {
    color: #ffc107;
    font-weight: bold;
}

.working-on {
    background: #e3f2fd;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #1976d2;
    font-weight: bold;
}

/* Back Office */
.backoffice-header {
    background: var(--banner-color);
    color: var(--title-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.backoffice-nav {
    background: #f8f9fa;
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
}

.nav-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
}

.nav-tab.active {
    border-bottom-color: var(--banner-color);
    color: var(--banner-color);
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.create-job-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.create-job-form input,
.create-job-form textarea,
.create-job-form select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.create-job-form textarea {
    height: 100px;
    resize: vertical;
}

.priority-list {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.priority-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    cursor: move;
}

.priority-handle {
    margin-right: 1rem;
    cursor: move;
    font-size: 1.2rem;
    opacity: 0.6;
}

.priority-job {
    flex: 1;
}

.priority-value {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.sub-tab-btn {
    background: #e9ecef;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
}

.sub-tab-btn.active {
    background: white;
    border-bottom: 1px solid white;
    font-weight: bold;
}

.sub-tab-content {
    display: none;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-top: none;
}

.sub-tab-content.active {
    display: block;
}

.time-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: end;
}

.time-filters input,
.time-filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.user-management {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.create-user-form {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

/* Settings Tab */
.settings-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.theme-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.theme-option {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.theme-option input[type="radio"] {
    margin-right: 0.5rem;
}

.color-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.color-setting {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-setting label {
    font-weight: bold;
}

.color-setting input[type="color"] {
    width: 50px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.terminal-management {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.terminal-management input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Notes Modal */
.note-item {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.note-header {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.note-content {
    margin-bottom: 0.5rem;
    color: #666;
}

.note-image {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 0.5rem;
}

/* Print Screen */
.print-container {
    padding: 2rem;
}

.print-controls {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

.btn-print {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
}

.btn-back {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
}

/* Setup Page */
.setup-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.setup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-delete:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .date-time-container {
        text-align: center;
    }
    
    .landing-buttons {
        grid-template-columns: 1fr;
    }
    
    .terminal-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .job-grid {
        grid-template-columns: 1fr;
    }
    
    .time-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .keyboard-row {
        flex-wrap: wrap;
    }
    
    .key {
        min-width: 30px;
        height: 40px;
        font-size: 0.8rem;
    }
    
    .logo-container {
        width: 400px; /* Smaller on mobile */
        height: 160px;
    }
}

/* Image Preview */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
}

.image-preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.preview-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    cursor: grab;
}

.close-preview {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .job-card {
        page-break-inside: avoid;
        border: 1px solid #000;
    }
    
    .print-container {
        padding: 0;
    }
}

/* Access Denied Page */
.access-denied-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.logo-large {
    margin-bottom: 2rem;
}

.logo-large img {
    width: 800px; /* 4x larger than original */
    height: 320px;
    object-fit: contain;
}

.access-denied-container h1 {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.access-denied-container p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.access-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.access-links a {
    background: #007bff;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.access-links a:hover {
    background: #0056b3;
}