* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Home Button Styles */
.home-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.home-text {
    display: inline-block;
}

.home-btn-small {
    background: #1e3c72;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 0.9em;
}

.home-btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
}

.home-btn-form {
    background: #1e3c72;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.home-btn-form:hover, .home-btn-small:hover, .home-btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Dashboard View */
.dashboard-view {
    padding: 30px;
    background: #f8f9fa;
}

.dashboard-stats {
    margin-bottom: 30px;
}

.stat-card-large {
    background: linear-gradient(135deg, #667eea 0%, #1e3c72 100%);
    border-radius: 20px;
    padding: 25px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.stat-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.stat-info h3 {
    margin-bottom: 20px;
    font-size: 1.3em;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-card {
    background: white;
    border: none;
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.action-icon {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
}

.action-text {
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

/* Recent Alerts */
.recent-alerts {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.recent-alerts h3 {
    margin-bottom: 15px;
    color: #1e3c72;
}

.alerts-list {
    max-height: 300px;
    overflow-y: auto;
}

.alert-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideIn 0.3s;
}

.alert-item.dropoff {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.alert-item.pickup {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
}

.alert-icon {
    font-size: 1.5em;
}

.alert-content {
    flex: 1;
}

.alert-name {
    font-weight: bold;
    display: block;
}

.alert-time {
    font-size: 0.8em;
    color: #666;
}

/* Live Status Bar */
.live-status {
    background: #f0f4f8;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
}

.status-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.status-label {
    font-weight: bold;
    color: #1e3c72;
    display: block;
    margin-bottom: 10px;
}

.stats-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stats-row span {
    font-size: 1.1em;
}

.stats-row strong {
    color: #2a5298;
    font-size: 1.2em;
    margin-left: 5px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #2a5298;
}

.tab-btn.active {
    background: white;
    color: #2a5298;
    border-bottom: 3px solid #2a5298;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.5s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Scan Container */
.scan-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .scan-container {
        grid-template-columns: 1fr;
    }
}

.camera-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}

.video-wrapper {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

video {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 60%;
    border: 3px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

.scan-text {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

@keyframes pulse {
    0%, 100% { border-color: #00ff00; box-shadow: 0 0 0 9999px rgba(0,0,0,0.3); }
    50% { border-color: #ffff00; box-shadow: 0 0 0 9999px rgba(0,0,0,0.2); }
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Activity Section */
.activity-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recent-activity, .currently-inside {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}

.recent-activity h3, .currently-inside h3 {
    margin-bottom: 15px;
    color: #1e3c72;
}

.activity-list, .inside-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s;
    border-left: 4px solid;
}

.activity-item.dropoff {
    border-left-color: #28a745;
}

.activity-item.pickup {
    border-left-color: #ff9800;
}

.activity-time {
    font-size: 0.8em;
    color: #666;
}

.inside-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inside-name {
    font-weight: 600;
}

.inside-time {
    font-size: 0.8em;
    color: #666;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-primary:hover, .btn-secondary:hover, .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.capture-area {
    text-align: center;
}

.capture-area video {
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
    border-radius: 10px;
}

.capture-preview {
    margin-top: 10px;
    text-align: center;
}

.capture-preview img {
    max-width: 150px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Children Grid */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.child-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    transition: transform 0.2s;
}

.child-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.child-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.child-card h3 {
    color: #333;
    margin-bottom: 5px;
}

.child-card p {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.status-inside {
    background: #ff9800;
    color: white;
}

.status-outside {
    background: #28a745;
    color: white;
}

/* Records List */
.records-list {
    margin-top: 20px;
}

.record-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.record-info {
    flex: 1;
}

.record-type {
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 5px;
}

.type-dropoff {
    background: #d4edda;
    color: #155724;
}

.type-pickup {
    background: #fff3cd;
    color: #856404;
}

.record-datetime {
    font-size: 0.85em;
    color: #666;
}

/* Report Table */
.report-table {
    overflow-x: auto;
    margin-top: 20px;
}

.report-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.report-table th, .report-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.report-table th {
    background: #1e3c72;
    color: white;
    font-weight: 600;
}

.report-table tr:hover {
    background: #f8f9fa;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.summary-card h4 {
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.summary-card .number {
    font-size: 2em;
    font-weight: bold;
}

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.record-filters, .report-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.record-filters select, .record-filters input,
.report-filters select, .report-filters input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Notification animation */
@keyframes notify {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.activity-item.new {
    animation: notify 0.5s ease;
}

/* Floating Notification */
.floating-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    animation: slideInRight 0.5s, fadeOut 0.5s 2.5s forwards;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.logo .icon {
    font-size: 2em;
}

.logo h1 {
    font-size: 1.5em;
}

.datetime {
    font-size: 0.9em;
    opacity: 0.9;
}