* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.camera-section {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.camera-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #4a9eff;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    position: relative;
}

header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

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

header #logoutBtn {
    margin-left: auto;
}

h1 {
    color: #4a9eff;
    font-size: 2rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.btn-primary {
    background-color: #4a9eff;
    color: white;
}

.btn-primary:hover {
    background-color: #3a8eef;
}

.btn-secondary {
    background-color: #555;
    color: white;
}

.btn-secondary:hover {
    background-color: #666;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 16px;
}

.auth-form input:focus {
    outline: none;
    border-color: #4a9eff;
}

.auth-form button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

.error-message {
    color: #ff4444;
    margin-top: 10px;
    text-align: center;
}

.camera-container {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.controls {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.video-container {
    position: relative;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

#videoPlayer {
    width: 100%;
    max-height: 600px;
    background-color: #000;
}

.status-message {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #4a9eff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

.info-panel {
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
}

.info-panel h3 {
    margin-bottom: 15px;
    color: #4a9eff;
}

#cameraInfo p {
    margin-bottom: 10px;
}

.status-connected {
    color: #4caf50;
}

.status-disconnected {
    color: #ff4444;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.modal-content h2 {
    color: #4a9eff;
    margin-bottom: 20px;
    text-align: center;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #e0e0e0;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 5px;
    color: #e0e0e0;
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a9eff;
}

.form-info {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border-left: 3px solid #ffa500;
}

.form-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #ccc;
}

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

.pin-section {
    text-align: center;
    margin-bottom: 20px;
}

.pin-section p {
    margin-bottom: 10px;
    color: #aaa;
    font-size: 14px;
}

.pin-input-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.pin-input {
    width: 120px;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 10px;
    background-color: #333;
    border: 2px solid #444;
    border-radius: 8px;
    color: #e0e0e0;
}

.pin-input:focus {
    border-color: #4a9eff;
    outline: none;
}

.biometric-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background-color: #2a2a2a;
    border: 2px solid #4a9eff;
    transition: all 0.3s ease;
}

.biometric-btn:hover {
    background-color: #3a3a3a;
    border-color: #5aafff;
    transform: translateY(-1px);
}

.biometric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.biometric-icon img {
    width: 100%;
    height: 100%;
    vertical-align: middle;
}

/* Platform-specific styling */
.biometric-ios {
    border-color: #007AFF;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.biometric-macos {
    border-color: #0070F3;
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
}

.biometric-android {
    border-color: #4CAF50;
}

.biometric-windows {
    border-color: #00BCF2;
}

.divider {
    text-align: center;
    margin: 20px 0;
    color: #666;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: #444;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.session-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff9800;
    color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.warning-content button {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: white;
    color: #ff9800;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Connection Panel Styles */
.connection-panel {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #4a9eff;
    box-shadow: 0 4px 8px rgba(74, 158, 255, 0.2);
}

.connection-panel h3 {
    color: #4a9eff;
    margin-bottom: 15px;
    text-align: center;
}

/* Camera Dashboard Styles */
.camera-dashboard {
    margin-bottom: 30px;
}

.camera-dashboard h2 {
    color: #4a9eff;
    margin-bottom: 25px;
    text-align: center;
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.camera-card {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.camera-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    border-color: #4a9eff;
}

.camera-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.camera-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.2rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.status-connected {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.status-badge.status-disconnected {
    background-color: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
}

.camera-info {
    margin-bottom: 20px;
}

.camera-info p {
    margin: 8px 0;
    color: #ccc;
    font-size: 14px;
}

.camera-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    flex: 1;
    text-align: center;
}

.btn:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Camera Viewer Styles */
.camera-viewer {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.viewer-header h3 {
    margin: 0;
    color: #4a9eff;
    font-size: 1.4rem;
}

.viewer-controls {
    display: flex;
    gap: 10px;
}

.viewer-controls .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* Enhanced Info Panel */
.info-panel h4 {
    margin-bottom: 15px;
    color: #4a9eff;
    font-size: 1.1rem;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-connected .status-indicator::before {
    background-color: #4caf50;
    box-shadow: 0 0 6px #4caf50;
}

.status-disconnected .status-indicator::before {
    background-color: #ff4444;
    box-shadow: 0 0 6px #ff4444;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .controls {
        justify-content: space-around;
    }
    
    .btn {
        margin: 5px;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .camera-grid {
        grid-template-columns: 1fr;
    }
    
    .viewer-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .viewer-controls {
        justify-content: center;
    }
    
    .camera-actions {
        flex-direction: column;
    }
}