/* ===================================
   IMACS Teknisi WebApp - Clean Design
   =================================== */

/* CSS Variables - SOFT PASTEL COLORS (Like Location Card) */
:root {
    /* Soft Pastel Colors - Friendly & Modern */
    --white: #ffffff;
    --black: #2c3e50;
    
    /* Soft Green (Like Location Card) */
    --green-soft: #e8f5e9;
    --green-border: #4caf50;
    --green-text: #2e7d32;
    
    /* Soft Red */
    --red-soft: #ffebee;
    --red-border: #d32f2f;
    --red-text: #c62828;
    
    /* Soft Blue */
    --blue-soft: #e3f2fd;
    --blue-border: #2196f3;
    --blue-text: #1565c0;
    
    /* Soft Yellow */
    --yellow-soft: #fff8e1;
    --yellow-border: #ffc107;
    --yellow-text: #f57c00;
    
    /* Soft Purple/Pink (Like Clock Out Button) */
    --pink-gradient-start: #f093fb;
    --pink-gradient-end: #f5576c;
    
    /* Functional Colors */
    --primary-color: var(--blue-border);
    --secondary-color: #95a5a6;
    --success-color: var(--green-border);
    --danger-color: var(--red-border);
    --warning-color: var(--yellow-border);
    --info-color: var(--blue-border);
    
    /* Background - Soft & Clean */
    --bg-primary: var(--white);
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #ecf0f1;
    
    /* Text - Soft Black */
    --text-primary: var(--black);
    --text-secondary: #7f8c8d;
    --text-light: #bdc3c7;
    
    /* Border - Soft */
    --border-color: #e0e0e0;
    --border-dark: #95a5a6;
    
    /* Shadow - Soft */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    
    /* Icon Color - Soft Blue */
    --icon-color: var(--blue-border);
    
    --bottom-nav-height: 65px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 9999;
}

.loading-screen p {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100vw;
    overflow: hidden;
}

/* Header */
.app-header {
    background: var(--bg-primary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
}

.user-details h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.user-details p {
    font-size: 13px;
    color: var(--text-secondary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 0;
    border: 1px solid var(--black);
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
}

.status-badge.active .status-dot {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

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

/* Content Container */
.content-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: var(--bottom-nav-height);
}

.page-content {
    min-height: calc(100vh - 80px - var(--bottom-nav-height));
    display: flex;
    flex-direction: column;
}

/* Page Header */
.page-header {
    background: var(--bg-primary);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-header i {
    color: var(--icon-color);
}

/* Icon Style - Always Blue */
.icon {
    color: var(--icon-color) !important;
}

.btn-back {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

/* Location Display - Soft Green Card (Like Screenshot) */
.location-display {
    background: var(--green-soft);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid var(--green-border);
    border-radius: 12px;
    margin: 15px 20px;
    box-shadow: var(--shadow-sm);
}

.location-icon {
    font-size: 32px;
    color: var(--icon-color);
    animation: pulse 2s infinite;
}

.location-text {
    flex: 1;
}

.location-text #locationCoords {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.location-text .text-small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Action Panel */
.action-panel {
    padding: 20px;
    background: var(--bg-primary);
}

.clock-in-panel,
.working-panel,
.completed-panel,
.no-shift-panel {
    text-align: center;
}

.time-display {
    margin-bottom: 20px;
}

.current-time {
    font-size: 48px;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.current-date {
    font-size: 14px;
    color: var(--text-secondary);
}

.location-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--blue-soft);
    border-radius: 12px;
    border: 2px solid var(--blue-border);
    margin: 15px 0;
    box-shadow: var(--shadow-sm);
}

.location-icon {
    font-size: 24px;
}

.shift-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.shift-morning {
    background: var(--green-soft);
    color: var(--green-text);
    border: 2px solid var(--green-border);
}

.shift-afternoon {
    background: var(--yellow-soft);
    color: var(--yellow-text);
    border: 2px solid var(--yellow-border);
}

.shift-night {
    background: var(--blue-soft);
    color: var(--blue-text);
    border: 2px solid var(--blue-border);
}

/* Buttons - Soft Rounded Style */
.btn-primary,
.btn-secondary,
.btn-danger {
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.btn-large {
    width: 100%;
    padding: 18px;
    font-size: 17px;
    border-radius: 16px;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-text {
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Working Panel */
.work-timer {
    background: var(--blue);
    padding: 25px;
    border-radius: 0;
    border: 2px solid var(--black);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.timer-label {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 8px;
}

.timer-value {
    font-size: 42px;
    font-weight: 600;
    color: white;
    letter-spacing: 2px;
}

.tracking-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: var(--green-soft);
    border-radius: 12px;
    border: 2px solid var(--green-border);
    margin-bottom: 20px;
    color: var(--green-text);
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.work-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 0;
}

.detail-item .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-item .value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

/* Completed Panel */
.success-icon,
.warning-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.completed-panel h2,
.no-shift-panel h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.summary {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 0;
    margin: 20px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item.highlight {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    border-radius: 0;
    margin-top: 10px;
}

.thank-you {
    margin: 20px 0;
    color: var(--text-secondary);
}

/* Job Stats */
.job-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
    background: var(--bg-primary);
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 0;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Job List */
.job-list {
    padding: 15px;
}

.job-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-border);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.job-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.job-id {
    font-size: 12px;
    color: var(--text-light);
}

.job-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.job-status-badge.new {
    background: var(--blue-soft);
    color: var(--blue-text);
    border: 2px solid var(--blue-border);
}

.job-status-badge.confirmed {
    background: var(--yellow-soft);
    color: var(--yellow-text);
    border: 2px solid var(--yellow-border);
}

.job-status-badge.on_site {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 2px solid #9c27b0;
}

.job-status-badge.in_progress {
    background: var(--blue-soft);
    color: var(--blue-text);
    border: 2px solid var(--blue-border);
}

.job-status-badge.completed {
    background: var(--green-soft);
    color: var(--green-text);
    border: 2px solid var(--green-border);
}

.job-status-badge.failed {
    background: var(--red-soft);
    color: var(--red-text);
    border: 2px solid var(--red-border);
}

.job-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.job-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.job-info-item .icon {
    width: 16px;
    color: var(--primary-color);
}

/* Forms */
.report-form,
.request-form {
    padding: 20px;
    background: var(--bg-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--blue-border);
    box-shadow: 0 0 0 4px var(--blue-soft);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-control-file {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--border-color);
    border-radius: 0;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.3s;
}

.radio-label:hover {
    background: var(--border-color);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
}

.photo-preview {
    margin-top: 10px;
}

.photo-preview img {
    max-width: 100%;
    border-radius: 0;
}

/* History Lists */
.report-history,
.request-history {
    padding: 20px;
    background: var(--bg-secondary);
}

.report-history h3,
.request-history h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.report-list,
.request-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-item,
.request-item {
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 0;
    border: 1px solid var(--border-color);
}

.report-item h4,
.request-item h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.report-item p,
.request-item p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-primary);
    border-top: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    height: 100%;
    border: none;
    background: none;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-icon {
    font-size: 24px;
    color: var(--icon-color);
}

.nav-item.active .nav-icon {
    color: var(--icon-color);
}

.nav-item.active {
    color: var(--primary-color);
    background: var(--blue-soft);
    border-radius: 16px;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* Job Detail */
.job-detail {
    padding: 20px;
}

.detail-section {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 0;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.detail-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-row .value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    text-align: right;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 480px) {
    .page-header h2 {
        font-size: 18px;
    }
    
    .current-time {
        font-size: 40px;
    }
    
    .timer-value {
        font-size: 32px;
    }
}
