:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);

    --primary: #f9a8d4;
    --primary-hover: #f472b6;
    --secondary: #fbcfe8;
    --secondary-hover: #f9a8d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Background Animations */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(249, 168, 212, 0.3) 0%, rgba(15, 23, 42, 0) 70%);
}

.blob2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(251, 207, 232, 0.2) 0%, rgba(15, 23, 42, 0) 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 10%) scale(1.1);
    }
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-box {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(249, 168, 212, 0.3);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.avatar img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
}

/* Main Layout */
.top-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

/* Current Status Card */
.current-status-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.time-display {
    margin-bottom: 2rem;
}

#current-time {
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
}

#current-date {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    position: relative;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-muted);
    transition: all 0.3s ease;
}

.pulse-ring {
    position: absolute;
    left: calc(1.5rem - 4px);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    opacity: 0;
}

/* Status Modifiers */
.status-indicator.working .dot {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-indicator.working .pulse-ring {
    border: 2px solid var(--success);
    animation: pulsate 2s infinite ease-out;
}

.status-indicator.paused .dot {
    background-color: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

.status-indicator.paused .pulse-ring {
    border: 2px solid var(--warning);
    animation: pulsate 2s infinite ease-out;
}

@keyframes pulsate {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Actions Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.btn {
    flex: 1;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-primary {
    background: var(--primary);
    box-shadow: 0 4px 20px rgba(249, 168, 212, 0.2);
}

.btn-primary:not(:disabled):hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
    color: #fff;
}

.btn-warning:not(:disabled):hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.btn-danger:not(:disabled):hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
}

.btn-secondary:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
    flex: unset;
}

/* Stats Columns */
.stats-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
}

.stat-icon.primary {
    background: rgba(249, 168, 212, 0.1);
    color: var(--primary);
}

.stat-icon.secondary {
    background: rgba(251, 207, 232, 0.1);
    color: var(--secondary);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
}

/* Records Section */
.records-section {
    padding: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.active {
    background: rgba(249, 168, 212, 0.1);
    color: var(--primary);
}

.compliance-note {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
}

.compliance-note ion-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 900px) {
    .top-row {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .current-status-card {
        padding: 2rem;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
    }

    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .user-info {
        flex-direction: row-reverse;
    }

    .user-details {
        align-items: flex-start;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* GPS Loader styling */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

.loader-content {
    text-align: center;
    color: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spin-icon {
    font-size: 4rem;
    animation: gpsPulse 1.5s infinite ease-in-out;
}

@keyframes gpsPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
        color: var(--primary);
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        color: var(--success);
    }

    100% {
        transform: scale(0.9);
        opacity: 0.5;
        color: var(--primary);
    }
}

th,
td {
    white-space: nowrap;
}

.table-container {
    -webkit-overflow-scrolling: touch;
}

/* Map Overlay */
.map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.map-modal-overlay.active {
    display: flex;
}

.map-panel {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    text-align: center;
}

/* Auth Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.auth-panel {
    width: 100%;
    max-width: 450px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-header {
    flex-direction: column;
    text-align: center;
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    margin-top: 1rem;
}

.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.auth-tab.active {
    background: var(--primary);
    color: var(--bg-dark);
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.input-group ion-icon {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.w-100 {
    width: 100%;
}

.auth-message {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
    min-height: 20px;
}

.error-text {
    color: var(--danger);
}

.success-text {
    color: var(--success);
}
