/* Modern Attendance System CSS - Mobile & Tablet Responsive */

:root {
    --primary-blue: #4F46E5;
    --primary-blue-hover: #4338CA;
    --punch-in-blue: #5570F1;
    --punch-out-salmon: #F87171;
    --camera-green: #10B981;
    --bg-app: #F4F6F9;
    --bg-card: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --header-bg: #FFFFFF;
    --table-header-bg: #37475F;
    --pink-weekly-off: #FFE4E6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

.attendance-page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* App Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 1.5rem;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #475569;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box input {
    width: 100%;
    padding: 7px 12px 7px 36px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    background-color: #F1F5F9;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    background-color: #FFFFFF;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
}

.notification-badge {
    position: relative;
    cursor: pointer;
}

.notification-badge .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}

/* Punch Main Card */
.punch-main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.punch-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 650px;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.punch-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-select-custom, .form-textarea-custom {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 14px;
    background-color: #FFFFFF;
    color: #1E293B;
    outline: none;
    box-sizing: border-box;
}

.form-select-custom:focus, .form-textarea-custom:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-textarea-custom {
    height: 44px;
    resize: none;
}

.gps-status-box {
    background-color: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Camera Frame Styling */
.camera-viewport-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.camera-frame-wrapper {
    width: 260px;
    height: 240px;
    border: 2px dashed #94A3B8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F8FAFC;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.video-stream, .canvas-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.camera-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-actions {
    margin-top: 1rem;
}

.btn-camera {
    background-color: var(--camera-green);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-camera:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.btn-retake {
    background-color: #64748B;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* Action Buttons */
.punch-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.btn-punch {
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-punch-in {
    background: linear-gradient(135deg, #5B73F2 0%, #4352E8 100%);
    box-shadow: 0 4px 12px rgba(85, 112, 241, 0.3);
}

.btn-punch-in:hover {
    box-shadow: 0 6px 16px rgba(85, 112, 241, 0.4);
    transform: translateY(-1px);
}

.btn-punch-out {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

.btn-punch-out:hover {
    box-shadow: 0 6px 16px rgba(248, 113, 113, 0.4);
    transform: translateY(-1px);
}

.report-link-container {
    text-align: center;
    margin-top: 0.5rem;
}

.report-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.report-link:hover {
    text-decoration: underline;
}

/* Attendance Report Page */
.report-main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.report-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: 0.5px;
    margin: 0;
}

.btn-primary-action {
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.emp-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #0F172A;
}

.emp-subtitle {
    font-size: 12px;
    color: #64748B;
}

.filter-dropdowns {
    display: flex;
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-group label {
    font-size: 11px;
    color: #64748B;
}

.form-select-sm {
    padding: 4px 8px;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    font-size: 13px;
}

/* Report Table Styling matching Image 2 */
.table-responsive-wrapper {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.report-table th {
    background-color: var(--table-header-bg);
    color: #FFFFFF;
    font-weight: 600;
    padding: 10px 12px;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.report-table th:last-child {
    border-right: none;
}

.report-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    white-space: nowrap;
}

.row-weekly-off {
    background-color: var(--pink-weekly-off) !important;
}

.font-bold { font-weight: bold; }
.text-red { color: #DC2626; }
.text-green { color: #16A34A; }
.text-availed { color: #0D9488; font-size: 12px; }

/* Location Clickable Badges */
.loc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.loc-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.loc-office {
    background-color: #EEF2FF;
    color: #3730A3;
    border-color: #C7D2FE;
}

.loc-home {
    background-color: #ECFDF5;
    color: #065F46;
    border-color: #A7F3D0;
}

.loc-client {
    background-color: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.icon-camera-mini {
    font-size: 11px;
}

.status-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.status-auto { color: #16A34A; }
.status-approved { color: #059669; }

/* Modal Dialog Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.hidden { display: none !important; }

.modal-card {
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 14px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F8FAFC;
}

.modal-heading {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748B;
    cursor: pointer;
}

.modal-body {
    padding: 1.25rem;
}

.modal-image-container {
    width: 100%;
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    margin-bottom: 1rem;
}

.modal-selfie-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    font-size: 13px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-label {
    font-size: 11px;
    color: #64748B;
    font-weight: 600;
    text-transform: uppercase;
}

.detail-value {
    color: #1E293B;
    font-weight: 500;
}

.badge-highlight {
    background: #EEF2FF;
    color: #4338CA;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    font-weight: 700;
}

.code-font {
    font-family: monospace;
    background: #F1F5F9;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.modal-footer {
    padding: 0.75rem 1.25rem;
    background: #F8FAFC;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.btn-modal-close {
    background: #64748B;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* App Footer */
.app-footer {
    height: 48px;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748B;
}

.brand-logo {
    font-weight: 800;
    color: #2563EB;
}

.brand-sub {
    font-size: 10px;
    color: #94A3B8;
    margin-left: 4px;
}

/* Responsive Styles for Mobile & Tablet */
@media (max-width: 768px) {
    .punch-form-row {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        display: none;
    }
    
    .report-main-content {
        padding: 1rem;
    }

    .filter-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .punch-card {
        padding: 1.25rem;
    }
}
