/* Custom styles for SATT - Smart Attendance Tracking Tool */

/* General styles */
body {
    padding-bottom: 2rem;
}

/* Navbar custom styles */
.navbar-brand {
    font-weight: bold;
}

/* Card styles */
.card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Button styles */
.btn-check {
    padding: 15px 30px;
    font-size: 1.2rem;
}

/* Location status */
#locationStatus {
    padding: 20px;
}

/* Attendance form */
#attendanceForm {
    padding: 10px 0;
}

/* Table styles */
.table th {
    background-color: #f8f9fa;
}

/* Badge customization */
.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-primary {
    background-color: #007bff;
}

/* Animation for check-in/out success */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#attendanceSuccess {
    animation: fadeIn 0.5s ease-in-out;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .btn-check {
        width: 100%;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Admin panel customizations */
.admin-header {
    background-color: #343a40;
    color: white;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.25rem;
}

/* Map container */
.map-container {
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* PWA installation prompt */
.install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #343a40;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    display: none;
}

.install-prompt button {
    margin-left: 10px;
    padding: 5px 15px;
}

/* Offline notification */
.offline-notification {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
    }
}

/* Check-in/out option styles */
.check-option {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 100%;
}

.check-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.check-option.selected {
    border-color: #007bff;
    background-color: #f8f9fa;
}

#checkInOption .card-body {
    background-color: #f8fff8;
}

#checkOutOption .card-body {
    background-color: #fff8f8;
}

.check-option.selected#checkInOption {
    border-color: #28a745;
    background-color: #eaffea;
}

.check-option.selected#checkOutOption {
    border-color: #dc3545;
    background-color: #ffebeb;
}

.check-option .fas {
    transition: transform 0.3s ease;
}

.check-option:hover .fas,
.check-option.selected .fas {
    transform: scale(1.2);
}

/* Animation for selection */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.check-option.selected {
    animation: pulse 0.5s;
}

/* Validation error message */
#validationMessage {
    transition: all 0.3s ease;
}

/* Make sure form looks good on mobile devices */
@media (max-width: 576px) {
    .check-option {
        margin-bottom: 15px;
    }
}

/* GPS Accuracy Display Styles */
#gpsAccuracyDisplay {
    border-left: 4px solid #17a2b8;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
}

#gpsAccuracyDisplay.alert-success {
    border-left-color: #28a745;
    background-color: #d4edda;
}

#gpsAccuracyDisplay.alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
}

#gpsAccuracyDisplay .d-flex {
    align-items: center;
}

#gpsAccuracyDisplay i.fa-2x {
    color: inherit;
    opacity: 0.8;
}

#gpsAccuracyDisplay small {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: inline-block;
}

#gpsAccuracyDisplay small i {
    margin-right: 0.25rem;
}

/* GPS accuracy levels animation */
@keyframes gpsSignal {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

#gpsAccuracyDisplay .fas.fa-satellite {
    animation: gpsSignal 2s infinite;
}

/* Duplicate submission warning styles */
#duplicateWarning {
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* iOS Safari specific styles */
.ios-safari #duplicateWarning {
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* GPS accuracy meter visual indicator */
.gps-accuracy-meter {
    display: inline-flex;
    margin-left: 0.5rem;
    align-items: center;
}

.gps-accuracy-meter .signal-bar {
    width: 4px;
    height: 12px;
    margin: 0 1px;
    background-color: #dee2e6;
    border-radius: 2px;
}

.gps-accuracy-meter.excellent .signal-bar:nth-child(-n+5) {
    background-color: #28a745;
}

.gps-accuracy-meter.very-good .signal-bar:nth-child(-n+4) {
    background-color: #20c997;
}

.gps-accuracy-meter.good .signal-bar:nth-child(-n+3) {
    background-color: #17a2b8;
}

.gps-accuracy-meter.fair .signal-bar:nth-child(-n+2) {
    background-color: #ffc107;
}

.gps-accuracy-meter.poor .signal-bar:nth-child(1) {
    background-color: #fd7e14;
}

/* Location status enhanced */
#locationStatus {
    border-radius: 8px;
}

#locationStatus .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Mobile responsiveness for GPS display */
@media (max-width: 768px) {
    #gpsAccuracyDisplay .d-flex {
        flex-direction: column;
        text-align: center;
    }
    
    #gpsAccuracyDisplay .mr-3 {
        margin-right: 0 !important;
        margin-bottom: 1rem;
    }
    
    #gpsAccuracyDisplay small {
        font-size: 0.8rem;
    }
}