﻿/* LIT Schemaläggning - Custom Styles */

/* Status colors */
:root {
    --status-draft: #6c757d;
    --status-published: #0d6efd;
    --status-inprogress: #ffc107;
    --status-completed: #198754;
    --status-deviated: #dc3545;
    --status-cancelled: #6c757d;
    --status-missed: #fd7e14;
}

/* Status badges */
.status-draft { background-color: var(--status-draft) !important; color: white !important; }
.status-published { background-color: var(--status-published) !important; color: white !important; }
.status-inprogress { background-color: var(--status-inprogress) !important; color: black !important; }
.status-completed { background-color: var(--status-completed) !important; color: white !important; }
.status-deviated { background-color: var(--status-deviated) !important; color: white !important; }
.status-cancelled { background-color: var(--status-cancelled) !important; color: white !important; }
.status-missed { background-color: var(--status-missed) !important; color: white !important; }

/* Shift cards */
.shift-card {
    border-left: 4px solid;
    margin-bottom: 0.5rem;
    transition: transform 0.1s ease-in-out;
}

.shift-card:hover {
    transform: translateX(2px);
}

.shift-card.status-draft { border-left-color: var(--status-draft); }
.shift-card.status-published { border-left-color: var(--status-published); }
.shift-card.status-inprogress { border-left-color: var(--status-inprogress); }
.shift-card.status-completed { border-left-color: var(--status-completed); }
.shift-card.status-deviated { border-left-color: var(--status-deviated); }

/* Worker mobile UI */
.btn-checkin {
    font-size: 1.5rem;
    padding: 1rem 2rem;
}

.worker-card {
    border-radius: 1rem;
}

@media (max-width: 768px) {
    .btn-checkin {
        width: 100%;
        font-size: 1.25rem;
    }
    
    .worker-card {
        margin-bottom: 1rem;
    }
}

/* Dashboard KPI cards */
.card.border-warning:hover,
.card.border-primary:hover,
.card.border-danger:hover,
.card.border-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

/* Schedule week view */
.schedule-day {
    min-height: 200px;
}

.schedule-day .card-header {
    font-weight: 600;
}

/* Login page */
.login-card {
    max-width: 400px;
    margin: 0 auto;
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Navbar */
.navbar-brand i {
    margin-right: 0.5rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Loading spinner for GPS */
.gps-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

/* Print styles */
@media print {
    .navbar, footer, .btn, .no-print {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
}

/* Animation for alerts */
.alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Badge improvements */
.badge {
    font-weight: 500;
}

/* Form improvements */
.form-label {
    font-weight: 500;
}

/* Card header icons */
.card-header i {
    margin-right: 0.5rem;
}


/* Progress bar for time */
.progress {
    border-radius: 1rem;
}

/* Responsive table on mobile */
@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* ============================================
   PWA STYLES
   ============================================ */

/* Standalone mode - extra padding för notch */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .navbar {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }
}

/* Offline banner */
#offlineBanner {
    animation: slideDown 0.3s ease-out;
}

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

/* Install prompt */
#installPrompt {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 576px) {
    .btn-lg {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Större touch targets */
    .list-group-item, 
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
    
    /* Checkin-knapp extra stor på mobil */
    .btn-checkin {
        width: 100%;
        padding: 1.5rem;
        font-size: 1.25rem;
        border-radius: 1rem;
    }
}

/* Syncing indicator */
.sync-indicator {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* iOS rubber-band scroll fix */
html, body {
    overscroll-behavior-y: contain;
}

