/* Clock System Custom Styles */
html, body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

#clock-system-root {
    height: 100vh;
    overflow: hidden;
    touch-action: none;
}

/* Remove padding from WordPress wrappers */
main {
    padding: 0 !important;
}

main .content-wrapper {
    padding: 0 !important;
    margin: 0 !important;
}

.entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide WordPress page title */
.page-title,
.entry-title,
h1.entry-title,
h1.page-title {
    display: none !important;
}

.pages-container {
    height: 100%;
    display: flex;
    transition: transform 0.3s ease-in-out;
}

.page {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Desktop/iPad: Reduce padding for better fit */
@media (min-width: 769px) {
    .page.p-4 {
        padding: 0.5rem !important;
    }
    .employee-avatar {
        width: 56px;
        height: 56px;
        font-size: 1.1rem;
    }
    .employee-fullname,
    .employee-surname {
        font-size: 0.9rem;
    }
}

/* Employee Card Styles */
.employee-card {
    border-radius: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), border 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 3px solid #d1d5db;
    background-color: #D8DBE2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Desktop/iPad: More compact card padding */
@media (min-width: 769px) {
    .employee-card {
        padding: 0.75rem;
    }
}

.employee-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.employee-card.checked-in {
    border-width: 3px;
    border-style: solid;
}

.employee-card.animating {
    transform: scale(0.8);
}

.employee-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

.employee-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    background-color: white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: filter 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Desktop/iPad: Smaller avatars for more compact layout */
@media (min-width: 769px) {
    .employee-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.3rem;
    }
}

.employee-card:not(.checked-in) .employee-avatar {
    filter: grayscale(100%);
    background-color: white;
}

.employee-card.checked-in .employee-avatar {
    background-color: white;
}

.plus-sign {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.employee-name-wrapper {
    text-align: center;
    width: 100%;
}

.employee-fullname {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.employee-surname {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
    letter-spacing: 0.5px;
    height: 1.32rem;
}

/* Force removal of Bootstrap text utilities */
.employee-fullname.text-dark,
.employee-surname.text-dark,
.employee-fullname.text-muted,
.employee-surname.text-muted {
    color: #374151 !important;
}

/* Base text color - ALL employee names default to dark grey */
.employee-fullname,
.employee-surname {
    color: #374151 !important;
    transition: color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Fallback: explicitly dark grey when NOT checked-in */
.employee-card:not(.checked-in) .employee-fullname,
.employee-card:not(.checked-in) .employee-surname {
    color: #374151 !important;
}

.employee-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

/* Page 1 layout */
.page-employee {
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Employee Layout Grid:
   Row 1: 4 standard cards
   Row 2: 4 standard cards
   Row 3: 1 std + grouped(2col) + 1 std
   Row 4: 2 large action cards (2col each)
*/
.employee-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 14px;
    flex: 1;
    overflow: hidden;
}

/* Rows 1–2: standard cards auto-place into first 8 cells */

/* Row 3: grouped section spans 2 columns */
.grouped-section {
    grid-column: span 2;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background-color: #D8DBE2;
    border-radius: 1rem;
    border: 3px solid #d1d5db;
    overflow: hidden;
    gap: 0;
}

.grouped-section .sub-card {
    flex: 1;
    border-radius: 0;
    border: none;
    border-right: 2px solid rgba(0,0,0,0.08);
    background-color: transparent;
}

.grouped-section .sub-card:last-child {
    border-right: none;
}

.grouped-section .sub-card.checked-in {
    border-radius: 0;
}

/* Row 4: action-row spans all columns, cards use flex:1 */
.action-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 14px;
}

.action-card {
    flex: 1;
    border-radius: 1rem;
    border: none;
    cursor: pointer;
    padding: 0.7rem 1.5rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    text-align: left;
    gap: 1rem;
}

.action-card:active {
    transform: scale(0.98);
}

.action-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.action-card--register {
    background: #D7EDB8;
    color: #1C0221;
}

.action-card--login {
    background: #A2DAD6;
    color: #1C0221;
}

.action-card--manage {
    background: #fed6ab;
    color: #1C0221;
}

.action-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.action-card__sub {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 0.2rem;
}

/* Action area: sits at grid col 4, spans rows 3-4 — 3 stacked buttons */
.action-area {
    grid-column: 4;
    grid-row: 3 / span 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.action-area .action-card {
    flex: 1;
    min-height: 0;
}

/* Mobile view — rendered directly into #clock-system-root by JS on ≤768px */
.mobile-view {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 12px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
}

.mobile-name-row {
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.mobile-name-guest {
    background: linear-gradient(135deg, #D7EDB8 0%, #7AB5AB 100%);
    color: #1C0221;
}

.mobile-empty-state {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

/* Guest Card Styles */
.guest-card {
    background: linear-gradient(135deg, #D7EDB8 0%, #7AB5AB 100%);
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: left;
}

.guest-card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.guest-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.guest-card h5 {
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
}

.guest-card p {
    font-size: 0.9rem;
    line-height: 1.3;
    margin: 0;
}

/* iPad and larger: 4 cards per row */
@media (min-width: 769px) {
    .guest-card-col {
        width: 25% !important;
        max-width: 25% !important;
        flex: 0 0 25% !important;
    }
}

@media (max-width: 768px) {
    .guest-card {
        padding: 0.75rem;
        min-height: 65px;
    }

    .guest-card h5 {
        font-size: 0.95rem;
    }

    .guest-card p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .guest-card {
        padding: 0.5rem;
        min-height: 60px;
    }

    .guest-card h5 {
        font-size: 0.9rem;
    }

    .guest-card p {
        font-size: 0.8rem;
    }
}

/* Keyboard Overlay */
.keyboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.keyboard-container {
    background: white;
    border-radius: 1rem 1rem 0 0;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

@media (min-width: 768px) {
    .keyboard-container {
        border-radius: 1rem;
    }
}

@media (max-width: 480px) {
    .keyboard-container {
        max-height: 85vh;
        max-width: 100%;
    }
}

.keyboard-key {
    min-width: 40px;
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: #e5e7eb;
    border: none;
    transition: background-color 0.2s;
    font-size: 1rem;
    color: #1C0221;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.keyboard-key:hover {
    background-color: #d1d5db;
}

.keyboard-key:active {
    background-color: #9ca3af;
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .keyboard-key {
        min-width: 36px;
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .keyboard-key {
        min-width: 32px;
        min-height: 36px;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Input Field Styles */
.input-display {
    background-color: #f3f4f6;
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 60px;
    font-size: 1.25rem;
    color: #1C0221;
    word-break: break-word;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .input-display {
        font-size: 1.1rem;
        min-height: 50px;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .input-display {
        font-size: 1rem;
        min-height: 45px;
        padding: 0.5rem;
    }
}

.field-selector {
    background-color: #f3f4f6;
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 50px;
    font-size: 1.125rem;
    color: #1C0221;
    text-align: left;
    border: 2px solid transparent;
    transition: all 0.2s;
    width: 100%;
    cursor: pointer;
}

.field-selector:hover {
    background-color: #e5e7eb;
}

.field-selector:active {
    transform: scale(0.98);
}

.field-selector.active {
    border-color: #739D3A;
    box-shadow: 0 0 0 3px rgba(115, 157, 58, 0.1);
}

@media (max-width: 768px) {
    .field-selector {
        min-height: 44px;
        font-size: 1rem;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .field-selector {
        min-height: 40px;
        font-size: 0.95rem;
        padding: 0.5rem;
    }
}

/* Navigation Arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 40;
    transition: background-color 0.2s;
}

.nav-arrow:hover {
    background-color: #4f46e5;
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.nav-arrow.left {
    left: 1rem;
}

.nav-arrow.right {
    right: 1rem;
}

@media (max-width: 768px) {
    .nav-arrow {
        width: 44px;
        height: 44px;
    }

    .nav-arrow.left {
        left: 0.5rem;
    }

    .nav-arrow.right {
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .nav-arrow {
        display: none;
    }
}

/* Page Indicators - hidden */
.page-indicators {
    display: none;
}

/* Check-in buttons */
.checkin-button {
    padding: 1.5rem;
    min-height: 80px;
    border-radius: 1rem;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    cursor: pointer;
}

.checkin-button:active {
    transform: scale(0.98);
}

.checkin-button:hover {
    transform: scale(1.05);
}

.checkin-button.register {
    background: linear-gradient(135deg, #1C0221 0%, #2a1a2e 100%);
}

.checkin-button.register:hover {
    background: linear-gradient(135deg, #150018 0%, #1f1320 100%);
}

.checkin-button.login {
    background: linear-gradient(135deg, #9AD14D 0%, #7ab535 100%);
    color: #1C0221 !important;
}

.checkin-button.login:hover {
    background: linear-gradient(135deg, #8bc73d 0%, #6a9028 100%);
}

.checkin-button.back {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    min-width: 80px;
    width: 80px;
}

.checkin-button.back:hover {
    background: linear-gradient(135deg, #5a6370 0%, #3a4452 100%);
}

.guest-back-btn {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 10;
}

@media (max-width: 768px) {
    .checkin-button {
        padding: 1rem;
        min-height: 70px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .checkin-button {
        padding: 0.75rem;
        min-height: 60px;
        font-size: 0.85rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #clock-system-root {
        height: 100vh;
    }
    
    .employee-layout {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: none;
        grid-auto-rows: auto;
        gap: 0.5rem;
        overflow-y: auto;
        padding: 0.5rem;
    }

    .grouped-section {
        grid-column: span 2;
    }

    .action-row {
        gap: 8px;
    }
    
    .employee-card {
        padding: 0.75rem;
        border-radius: 0.75rem;
    }
    
    .employee-avatar {
        width: 48px;
        height: 48px;
        font-size: 0.9rem;
    }
    
    .employee-fullname {
        font-size: 0.85rem;
    }
    
    .employee-surname {
        font-size: 0.85rem;
        height: auto;
    }
    
    .checkin-button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .keyboard-container {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .employee-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        padding: 0.25rem;
    }
    
    .employee-card {
        padding: 0.5rem;
        border-radius: 0.5rem;
    }
    
    .employee-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
    
    .employee-fullname {
        font-size: 0.75rem;
    }
    
    .employee-surname {
        font-size: 0.75rem;
    }
    
    .employee-name {
        font-size: 0.55rem;
    }
    
    /* Mobile scroll improvements */
    .guest-section {
        padding: 0.75rem;
    }

    .guest-section h2 {
        margin-top: 0.5rem;
        margin-left: 0.5rem;
        font-size: 1rem;
    }

    .checkin-section {
        padding: 0.75rem;
        min-height: 140px;
    }

    .page {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Utility classes */
.text-muted {
    color: #6b7280;
}

.text-placeholder {
    color: #9ca3af;
}

.guest-section {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
    background: white;
    border-bottom: 4px solid #117A72;
    min-height: 0;
}

.guest-section h2 {
    margin-top: 1rem;
    margin-left: 1rem;
}

.checkin-section {
    display: none;
}

.border-custom {
    border-bottom: 4px solid #117A72;
}

/* Check Out Button */
.btn-danger {
    background-color: #1C0221 !important;
    border-color: #1C0221 !important;
}

.btn-danger:hover {
    background-color: #150018 !important;
    border-color: #150018 !important;
}

/* Login popup Close button only */
.login-keyboard-close {
    background-color: #117A72 !important;
    border-color: #117A72 !important;
}

.login-keyboard-close:hover {
    background-color: #0d5f59 !important;
    border-color: #0d5f59 !important;
}

/* Register popup Complete Registration button only */
.register-complete-btn {
    background-color: #739D3A !important;
    border-color: #739D3A !important;
}

.register-complete-btn:hover:not(:disabled) {
    background-color: #5e7f2e !important;
    border-color: #5e7f2e !important;
}

/* ============================================================
   iPad Air 2 optimisation — 768 × 1024 / 1024 × 768 CSS px
   Ensures full 4-row grid fits without overflow in landscape.
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Tighten outer page padding */
    .page-employee {
        padding: 16px;
    }

    /* Reduce grid and action-row gaps */
    .employee-layout {
        gap: 10px;
    }

    .action-row {
        gap: 10px;
    }

    /* Allow grid cells to shrink below their content size */
    .employee-card,
    .action-row {
        min-height: 0;
        overflow: hidden;
    }

    /* Compact card padding */
    .employee-card {
        padding: 0.5rem;
    }

    /* Reduce internal spacing */
    .employee-card-content {
        gap: 0.5rem;
    }

    /* Smaller avatars */
    .employee-avatar {
        width: 54px;
        height: 54px;
        font-size: 1rem;
    }

    /* Smaller name text */
    .employee-fullname,
    .employee-surname {
        font-size: 0.82rem;
    }

    /* Remove fixed surname height so it wraps naturally */
    .employee-surname {
        height: auto;
    }

    /* Compact action cards */
    .action-card {
        padding: 0.5rem 1rem;
        gap: 0.65rem;
    }

    .action-card svg {
        width: 26px;
        height: 26px;
        flex-shrink: 0;
    }

    .action-card__title {
        font-size: 0.95rem;
    }

    .action-card__sub {
        font-size: 0.75rem;
    }
}


