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

:root {
    --bg-gradient: radial-gradient(circle at 50% 50%, #1a103c 0%, #08051a 100%);
    --primary-cyan: #00f2fe;
    --primary-purple: #9b51e0;
    --text-color: #f1f1f1;
    --text-muted: #a0a0c0;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-glow: rgba(0, 242, 254, 0.15);
    --glass-purple-glow: rgba(155, 81, 224, 0.2);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* App container constraints for mobile optimization */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: rgba(8, 5, 26, 0.95);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
}

/* Glassmorphism Card Layout */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: 0.75s;
    pointer-events: none;
}

.glass-card:active::before {
    left: 125%;
}

.glass-card.glow-cyan {
    box-shadow: var(--card-shadow), 0 0 15px var(--glass-glow);
    border-color: rgba(0, 242, 254, 0.25);
}

.glass-card.glow-purple {
    box-shadow: var(--card-shadow), 0 0 15px var(--glass-purple-glow);
    border-color: rgba(155, 81, 224, 0.25);
}

/* Headers & Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(8, 5, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-speed);
}

.menu-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Slide-out Sidebar for Mobile */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: rgba(10, 6, 30, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1000;
    transition: left var(--transition-speed) cubic-bezier(0.1, 0.9, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.sidebar-link i {
    font-size: 1.25rem;
    color: var(--primary-cyan);
}

.sidebar-link:active, .sidebar-link.active {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(155, 81, 224, 0.15));
    border-left: 4px solid var(--primary-cyan);
    padding-left: 12px;
}

.sidebar-link:active i {
    color: var(--text-color);
}

/* Forms & Inputs styling */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all var(--transition-speed);
}

select.form-control {
    background-color: #0e0a26 !important;
    color: #ffffff !important;
}

select.form-control option {
    background-color: #0e0a26 !important;
    color: #ffffff !important;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.form-control:disabled, .form-control[readonly] {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.05);
}

textarea.form-control {
    resize: none;
    min-height: 80px;
}

/* Checkbox and Radio styling */
.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.radio-btn {
    position: relative;
    display: flex;
    align-items: center;
}

.radio-btn input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.radio-btn input:checked + .radio-label {
    border-color: var(--primary-cyan);
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.15);
}

/* Dynamic Product Adder Grid */
.product-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: flex-end;
}

.product-row .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-purple) 100%);
    color: #08051a;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.btn-danger:active {
    background: rgba(255, 59, 48, 0.3);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    width: auto;
}

/* Circular Progress Bar (Target Widget) */
.circle-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.circular-progress {
    position: relative;
    width: 130px;
    height: 130px;
}

.circular-progress svg {
    width: 130px;
    height: 130px;
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 8;
}

.circular-progress .bg-circle {
    stroke: rgba(255, 255, 255, 0.05);
}

.circular-progress .fg-circle {
    stroke: url(#cyan-purple-grad);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.circular-progress .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.circular-progress .percentage {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-cyan);
}

.circular-progress .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Leaflet Map Styling Override */
.leaflet-container {
    background: #08051a !important;
}

#map {
    width: 100%;
    height: 250px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    z-index: 10;
    margin-bottom: 16px;
}

/* Attendance calendar widget */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    margin-top: 10px;
}

.calendar-day-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    position: relative;
    cursor: pointer;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.attended {
    border-color: var(--primary-cyan);
    background: rgba(0, 242, 254, 0.1);
    color: var(--primary-cyan);
    font-weight: 600;
}

.calendar-day.absent {
    border-color: rgba(255, 59, 48, 0.2);
    background: rgba(255, 59, 48, 0.05);
}

.calendar-day.today {
    box-shadow: 0 0 8px var(--primary-purple);
    border-color: var(--primary-purple);
}

/* Modals & Popups (Glassmorphism Modal) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: rgba(12, 8, 32, 0.95);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow), 0 0 30px rgba(0, 242, 254, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Captcha Layout */
.captcha-container {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.captcha-img {
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
}

/* File Upload custom input */
.file-upload-box {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all var(--transition-speed);
}

.file-upload-box:active {
    border-color: var(--primary-cyan);
    background: rgba(0, 242, 254, 0.05);
}

.file-upload-box i {
    font-size: 1.5rem;
    color: var(--primary-cyan);
    margin-bottom: 8px;
}

.file-upload-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-list {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    list-style: none;
}

.file-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* List/Dashboard lists */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.list-item:last-child {
    border-bottom: none;
}

.list-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.list-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-cyan {
    background: rgba(0, 242, 254, 0.15);
    color: var(--primary-cyan);
}

.badge-purple {
    background: rgba(155, 81, 224, 0.15);
    color: var(--primary-purple);
}

.badge-danger {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

.badge-success {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

/* Bottom Bar navigation for Executive */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(8, 5, 26, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    padding: 10px 0;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
    transition: color var(--transition-speed);
}

.bottom-nav-link i {
    font-size: 1.25rem;
}

.bottom-nav-link.active, .bottom-nav-link:active {
    color: var(--primary-cyan);
}

/* Metric Display values */
.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 4px;
    background: linear-gradient(45deg, #fff, var(--primary-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
