/* GeoCheck Attendance Pro Custom Stylesheet */

:root {
    /* Color Tokens */
    --color-background: #f8f9fa;
    --color-on-background: #191c1d;
    --color-primary: #003f87;
    --color-primary-hover: #002d62;
    --color-on-primary: #ffffff;
    --color-primary-container: #0056b3;
    --color-primary-container-hover: #004491;
    --color-on-primary-container: #bbd0ff;
    --color-secondary: #566067;
    --color-on-secondary: #ffffff;
    --color-secondary-container: #dae4ed;
    --color-on-secondary-container: #5c666d;
    --color-surface: #f8f9fa;
    --color-surface-container-lowest: #ffffff;
    --color-surface-container-high: #e7e8e9;
    --color-surface-container-highest: #e1e3e4;
    --color-outline-variant: #c2c6d4;
    --color-error: #ba1a1a;
    --color-error-container: #ffdad6;
    --color-on-error: #ffffff;
    --color-success: #2e7d32;
    --color-success-bg: #e8f5e9;

    /* Shape Tokens */
    --radius-card: 16px;
    --radius-button: 8px;
    --radius-input: 8px;
    --radius-chip: 4px;
}

/* Base resets & typography */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-background);
    color: var(--color-on-background);
    min-height: 100vh;
}

/* Material Icons configuration */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Custom premium styling */
.bg-background {
    background-color: var(--color-background) !important;
}

.text-primary {
    color: var(--color-primary) !important;
}

.bg-primary {
    background-color: var(--color-primary) !important;
}

.bg-primary-container {
    background-color: var(--color-primary-container) !important;
}

.text-on-primary-container {
    color: var(--color-on-primary-container) !important;
}

.text-secondary {
    color: var(--color-secondary) !important;
}

.bg-secondary-container {
    background-color: var(--color-secondary-container) !important;
}

.text-on-secondary-container {
    color: var(--color-on-secondary-container) !important;
}

.border-outline-variant {
    border-color: var(--color-outline-variant) !important;
}

/* Premium Elevating Cards (Stitch style) */
.card-premium {
    background-color: var(--color-surface-container-lowest);
    border-radius: var(--radius-card);
    border: 1px solid rgba(194, 198, 212, 0.3);
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
}

.card-shadow {
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
}

/* Buttons and Inputs */
.btn-primary-custom {
    background-color: var(--color-primary-container);
    color: var(--color-on-primary) !important;
    border-radius: var(--radius-button);
    font-weight: 600;
    height: 48px;
    border: none;
    transition: all 0.2s ease-in-out;
}

.btn-primary-custom:hover {
    background-color: var(--color-primary-container-hover);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

.btn-primary-custom:active {
    transform: scale(0.98);
}

.btn-secondary-custom {
    background-color: transparent;
    color: var(--color-primary) !important;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-button);
    font-weight: 600;
    height: 48px;
    transition: all 0.2s ease-in-out;
}

.btn-secondary-custom:hover {
    background-color: var(--color-secondary-container);
}

.form-control-custom {
    height: 48px;
    border-radius: var(--radius-input);
    border: 1px solid var(--color-outline-variant);
    padding: 0 16px;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
}

.form-control-custom:focus {
    border-color: var(--color-primary-container);
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.15);
    outline: none;
}

/* Top App Bar Styling */
.top-app-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-outline-variant);
    padding: 12px 20px;
}

/* Bottom Nav Bar Styling */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--color-surface-container-lowest);
    border-top: 1px solid var(--color-outline-variant);
    box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.03);
    padding: 8px 16px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-link {
    text-decoration: none;
    color: var(--color-secondary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.15s ease-in-out;
}

.bottom-nav-link.active {
    background-color: var(--color-secondary-container);
    color: var(--color-primary) !important;
}

.bottom-nav-link:hover {
    opacity: 0.8;
}

/* QR Scanner Styles */
.scanner-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    background-color: #0f172a;
    border-radius: 32px;
    box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.15);
    border: 4px solid var(--color-surface-container-high);
    overflow: hidden;
}

.scanner-frame {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: 24px;
    overflow: hidden;
}

.scanning-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--color-primary-container);
    box-shadow: 0 0 15px 3px rgba(0, 86, 179, 0.8);
    top: 0;
    animation: scan 2.5s infinite linear;
    z-index: 2;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid #ffffff;
    z-index: 10;
}
.corner-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.corner-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.corner-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.corner-br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }

/* Checkmark Success Animations */
@keyframes pulse-ring {
    0% { transform: scale(0.33); opacity: 0; }
    50% { opacity: 0.2; }
    100% { transform: scale(1.1); opacity: 0; }
}
@keyframes check-reveal {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-ring-effect {
    position: absolute;
    inset: 0;
    background-color: var(--color-success);
    border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

.check-reveal-effect {
    animation: check-reveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bg-success-custom {
    background-color: var(--color-success) !important;
}

.text-success-custom {
    color: var(--color-success) !important;
}

/* Spinner and Loaders */
.loader-ring {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary-container);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

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

/* Micro-animations */
.reveal {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Map Styling */
.map-view-container {
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--color-outline-variant);
}

#map {
    height: 100%;
    width: 100%;
}
