* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #d32f2f;
    --primary-dark: #b71c1c;
    --primary-light: #ff6659;
    --secondary: #2c3e50;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --emergency-bg: #fff3e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-strong: 0 4px 20px rgba(0,0,0,0.15);
}

.dark-theme {
    --background: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #404040;
    --emergency-bg: #332e1f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Lock Screen View */
.lock-screen-view {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    padding: 0 0 30px 0;
}

.emergency-banner {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-strong);
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.lock-screen-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.emergency-header {
    text-align: center;
    margin-bottom: 25px;
}

.emergency-icon {
    font-size: 60px;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.emergency-header h1 {
    color: white;
    font-size: 28px;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.lock-screen-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
}

.emergency-profile-card {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 25px 20px;
    box-shadow: var(--shadow-strong);
    border: 3px solid var(--primary-red);
    margin-bottom: 20px;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.no-data-card {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow-strong);
}

.no-data-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.register-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 15px 0;
}

.login-link a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

.emergency-person {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.emergency-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.emergency-person-details h2 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.emergency-blood-group {
    background: #ffebee;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid var(--primary-red);
}

.blood-label {
    font-weight: bold;
    color: var(--primary-red);
    font-size: 18px;
}

.blood-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-red);
}

.emergency-critical {
    background: var(--emergency-bg);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

.critical-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.critical-label {
    display: block;
    font-weight: bold;
    color: var(--primary-red);
    margin-bottom: 5px;
    font-size: 14px;
}

.emergency-ids {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.id-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.emergency-contacts-section h3 {
    color: var(--primary-red);
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
}

.emergency-contact-item {
    background: var(--card-bg);
    border: 2px solid var(--primary-red);
    border-radius: 50px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.contact-info .name {
    font-weight: bold;
    font-size: 18px;
    display: block;
}

.contact-info .phone {
    color: var(--primary-red);
    font-size: 14px;
}

.call-contact-btn {
    background: var(--success);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.emergency-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.emergency-call-all {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

.emergency-view-app {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
}

.emergency-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.app-signature {
    margin-top: 10px;
    font-style: italic;
    font-size: 12px;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

.auth-info {
    color: white;
    padding: 30px;
}

.auth-info h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.auth-info ul {
    list-style: none;
    margin-bottom: 30px;
}

.auth-info li {
    margin-bottom: 15px;
    font-size: 16px;
}

.developer {
    margin-top: 40px;
    font-size: 14px;
    opacity: 0.8;
}

.info-box {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

/* Dashboard */
.owner-nav {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-red);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-email {
    color: var(--text-secondary);
    font-size: 14px;
}

.logout-btn {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.dashboard-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.preview-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid var(--primary-red);
}

.preview-content {
    background: var(--emergency-bg);
    padding: 15px;
    border-radius: 8px;
}

.preview-badge {
    background: var(--primary-red);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

.preview-row {
    display: flex;
    margin-bottom: 8px;
}

.preview-label {
    width: 100px;
    font-weight: 600;
    color: var(--text-secondary);
}

.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-red);
    color: white;
}

.tab-content {
    display: none;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.tab-content.active {
    display: block;
}

.save-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

.add-btn {
    width: 100%;
    padding: 12px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
}

.contact-form {
    background: var(--background);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
}

.remove-contact {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

.settings-group {
    margin-bottom: 30px;
}

.settings-group h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.danger-btn {
    width: 100%;
    padding: 12px;
    background: var(--warning);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 3000;
    display: none;
    max-width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.toast-notification.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-info {
        display: none;
    }
    
    .emergency-person {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
}