/**
 * QuickBooks Time Kiosk - Enhanced Modern Design
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Hide WordPress theme elements for true fullscreen */
body.qbtk-kiosk-page {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.qbtk-kiosk-page #wpadminbar,
body.qbtk-kiosk-page .site-header,
body.qbtk-kiosk-page .site-footer,
body.qbtk-kiosk-page header,
body.qbtk-kiosk-page footer,
body.qbtk-kiosk-page nav,
body.qbtk-kiosk-page .entry-header,
body.qbtk-kiosk-page .entry-content > *:not(#qbtk-kiosk),
body.qbtk-kiosk-page .sidebar {
    display: none !important;
}

body.qbtk-kiosk-page .site-content,
body.qbtk-kiosk-page .content-area,
body.qbtk-kiosk-page .entry-content,
body.qbtk-kiosk-page main,
body.qbtk-kiosk-page article {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* Container with black background and gradient overlay - true fullscreen */
.qbtk-kiosk-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    background: #000000;
    background-image: 
        radial-gradient(ellipse at top left, rgba(6, 147, 227, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at top right, rgba(155, 81, 224, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(102, 126, 234, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(6, 147, 227, 0.2) 0%, transparent 50%),
        radial-gradient(circle at center, rgba(102, 126, 234, 0.1) 0%, transparent 60%);
    animation: gradientShift 20s ease infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    overflow: hidden;
    z-index: 999999 !important;
}

/* Animated particles background */
.qbtk-kiosk-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
                      radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%),
                      radial-gradient(circle at 40% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

/* Clock Display */
.qbtk-clock-display {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
    color: white;
    opacity: 0.9;
}

.qbtk-date {
    font-size: 18px;
    margin-bottom: 5px;
}

.qbtk-time {
    font-size: 36px;
    font-weight: 300;
}

/* Main Display with glassmorphism effect */
.qbtk-main-display {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.12),
                0 10px 25px rgba(0,0,0,0.08);
    padding: 60px;
    min-width: 500px;
    max-width: 600px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* States */
.qbtk-state {
    display: none;
}

.qbtk-state-active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Idle state with scanning indicator */
.qbtk-state-idle .qbtk-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: scanPulse 2s ease-out infinite;
}

@keyframes scanPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* Icons with enhanced animations */
.qbtk-icon {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.qbtk-icon .dashicons {
    width: 80px;
    height: 80px;
    font-size: 80px;
}

/* Animated success icon */
.qbtk-icon.success {
    color: #46b450;
    animation: punchSuccess 0.6s ease-out;
}

.qbtk-icon.success::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(70, 180, 80, 0.3) 0%, transparent 70%);
    animation: ripple 1s ease-out;
}

.qbtk-icon.info {
    color: #00a0d2;
    animation: pulse 2s infinite;
}

.qbtk-icon.warning {
    color: #ffba00;
}

.qbtk-icon.error {
    color: #dc3232;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Typography */
.qbtk-title {
    font-size: 36px;
    font-weight: 300;
    margin: 0 0 10px;
    color: #23282d;
}

.qbtk-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
}

.qbtk-employee-name {
    font-size: 32px;
    font-weight: 400;
    margin: 0 0 10px;
    color: #23282d;
}

.qbtk-message {
    font-size: 24px;
    color: #555;
    margin: 10px 0;
}

.qbtk-time-display {
    font-size: 18px;
    color: #999;
    margin-top: 20px;
}

/* Processing State with enhanced spinner */
.qbtk-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top: 4px solid #667eea;
    border-right: 4px solid #9b51e0;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 30px;
    position: relative;
}

.qbtk-spinner::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #0693e3;
    animation: spin 1.5s linear infinite reverse;
    opacity: 0.6;
}

/* Cooldown Timer with progress bar */
.qbtk-cooldown-timer {
    font-size: 28px;
    color: #555;
    margin-top: 20px;
    position: relative;
}

.qbtk-cooldown-seconds {
    font-weight: bold;
    color: #667eea;
    display: inline-block;
    min-width: 30px;
}

.qbtk-cooldown-progress {
    width: 100%;
    height: 6px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
    position: relative;
}

.qbtk-cooldown-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0693e3, #667eea, #9b51e0);
    background-size: 200% 100%;
    border-radius: 3px;
    animation: progressMove 2s linear infinite;
    transition: width 1s linear;
}

@keyframes progressMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Hidden Input */
.qbtk-badge-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Onboarding Container */
.qbtk-onboarding-container {
    text-align: center;
}

.qbtk-onboarding-step {
    display: none;
}

.qbtk-onboarding-step.qbtk-step-active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

.qbtk-onboarding-step h3 {
    font-size: 28px;
    font-weight: 400;
    margin: 0 0 20px;
    color: #23282d;
}

.qbtk-badge-display {
    font-size: 18px;
    color: #666;
    margin: 15px 0;
}

.qbtk-badge-display code {
    background: #f1f1f1;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 20px;
    color: #23282d;
}

/* PIN Input */
.qbtk-pin-form {
    margin: 30px 0;
}

.qbtk-pin-input-container {
    margin: 20px 0;
}

.qbtk-pin-input {
    font-size: 36px;
    text-align: center;
    letter-spacing: 10px;
    width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.qbtk-pin-input:focus {
    border-color: #667eea;
}

/* Employee Details */
.qbtk-employee-details {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.qbtk-employee-name-display {
    font-size: 24px;
    font-weight: 500;
    color: #23282d;
    margin: 0 0 10px;
}

/* Buttons */
.qbtk-button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.qbtk-button-primary {
    background: #667eea;
    color: white;
}

.qbtk-button-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.qbtk-button-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.qbtk-button-secondary:hover {
    background: #cbd5e0;
}

.qbtk-button-group {
    margin-top: 30px;
}

.qbtk-retry-button {
    background: #dc3232;
    color: white;
}

.qbtk-retry-button:hover {
    background: #c92c2c;
}

/* Debug Mode */
.qbtk-debug {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 5px;
    font-size: 12px;
    max-width: 400px;
}

.qbtk-debug h4 {
    margin: 0 0 10px;
    color: white;
}

.qbtk-debug-output {
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 3px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
    font-family: monospace;
}

.qbtk-debug .button {
    margin-right: 5px;
}

/* Success/Error Animations */
@keyframes punchSuccess {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes crossmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .qbtk-main-display {
        min-width: auto;
        width: 100%;
        max-width: 100%;
        padding: 40px 20px;
    }
    
    .qbtk-title {
        font-size: 28px;
    }
    
    .qbtk-subtitle {
        font-size: 16px;
    }
    
    .qbtk-message {
        font-size: 20px;
    }
    
    .qbtk-icon {
        font-size: 60px;
    }
    
    .qbtk-icon .dashicons {
        width: 60px;
        height: 60px;
        font-size: 60px;
    }
    
    .qbtk-clock-display {
        position: static;
        margin-bottom: 20px;
        text-align: center;
    }
}

/* Full Screen Mode */
.qbtk-kiosk-container.qbtk-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

/* Error Messages */
.qbtk-error {
    background: #ffebe8;
    border-left: 4px solid #dc3232;
    padding: 12px;
    margin: 20px 0;
}

/* Status Widget */
.qbtk-status-widget {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qbtk-status-value {
    font-size: 48px;
    font-weight: 300;
    color: #667eea;
    margin-bottom: 10px;
}

.qbtk-status-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Recent Punches */
.qbtk-recent-punches {
    text-align: left;
}

.qbtk-recent-punches h4 {
    margin: 0 0 15px;
    font-size: 18px;
}

.qbtk-recent-punches ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.qbtk-recent-punches li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qbtk-punch-time {
    font-size: 12px;
    color: #999;
}

.qbtk-punch-name {
    flex-grow: 1;
    margin: 0 10px;
    font-weight: 500;
}

.qbtk-punch-action {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.qbtk-punch-action.clock_in {
    background: #e6f7ed;
    color: #46b450;
}

.qbtk-punch-action.clock_out {
    background: #e8f4f8;
    color: #00a0d2;
}