/* Mobile-First Responsive CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    font-size: 16px;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px;
    text-align: center;
}

.header h1 {
    font-size: 22px;
    margin-bottom: 5px;
    font-weight: 600;
}

.header p {
    opacity: 0.95;
    font-size: 13px;
}

/* Content */
.content {
    padding: 20px 15px;
}

/* Form */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.text-warning {
    color: #856404;
}

.mt-3 {
    margin-top: 15px;
}

.mb-3 {
    margin-bottom: 15px;
}

/* Cards */
.attendance-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.attendance-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.attendance-card p {
    margin: 5px 0;
    font-size: 14px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.status-masuk {
    background: #28a745;
    color: white;
}

.status-keluar {
    background: #dc3545;
    color: white;
}

.status-terlambat {
    background: #ffc107;
    color: #212529;
}

/* Camera */
.camera-container {
    position: relative;
    margin: 15px 0;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

#camera {
    width: 100%;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

#canvas {
    display: none;
}

.capture-btn {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4757;
    color: white;
    border: 3px solid white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    touch-action: manipulation;
}

.capture-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.photo-preview {
    width: 100%;
    border-radius: 10px;
    margin: 10px 0;
    display: block;
}

/* Location Info */
.location-info {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13px;
    border-left: 3px solid #667eea;
}

.location-info h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.location-info p {
    margin: 4px 0;
    color: #555;
    line-height: 1.5;
}

.location-info strong {
    color: #333;
}

/* Admin Styles */
.admin-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow-x: auto;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-content {
    padding: 15px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
    overflow-x: auto;
    display: block;
}

.table thead,
.table tbody {
    display: block;
}

.table tr {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #dee2e6;
}

.table th,
.table td {
    padding: 10px 8px;
    flex: 1;
    min-width: 100px;
    text-align: left;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
}

/* Navbar */
.navbar {
    background: #f8f9fa;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 10px;
}

.nav-links a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: #667eea;
    color: white;
}

/* Tablet & Desktop */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }

    .container {
        max-width: 450px;
    }

    .content {
        padding: 25px;
    }

    .header {
        padding: 25px;
    }

    .header h1 {
        font-size: 26px;
    }

    .admin-container {
        max-width: 1200px;
    }

    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 20px 30px;
    }

    .admin-content {
        padding: 30px;
    }

    .table {
        display: table;
        font-size: 15px;
    }

    .table thead,
    .table tbody {
        display: table-row-group;
    }

    .table tr {
        display: table-row;
    }

    .table th,
    .table td {
        display: table-cell;
        padding: 12px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        padding: 10px 18px;
        font-size: 15px;
    }

    .location-info {
        padding: 15px;
        font-size: 14px;
    }

    .attendance-card {
        padding: 20px;
    }
}

/* Large Screens */
@media (min-width: 1024px) {
    .container {
        max-width: 500px;
    }

    .content {
        padding: 30px;
    }
}
