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

:root {
    --primary: #5b62ee;
    --primary-dark: #2e3092;
    --primary-light: #e0e7ff;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Status Colors */
    --normal-bg: #dcfce7;
    --normal-text: #16a34a;
    --warning-bg: #fee2e2;
    --warning-text: #dc2626;
    --info-bg: #e0e7ff;
    --info-text: #4f46e5;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* --- LOGIN PAGE STYLING --- */
.login-body {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 10% 20%, rgba(91, 98, 238, 0.1) 0%, rgba(239, 246, 255, 0.2) 90%);
}

.login-container {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    text-align: center;
    animation: slideUp 0.6s ease-out;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 8px 16px rgba(91, 98, 238, 0.3);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    animation: heartBeat 1.5s infinite;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Form inputs */
.form-group {
    margin-bottom: 20px;
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    color: var(--text-main);
}

.input-with-icon input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(91, 98, 238, 0.15);
}

.input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s;
}

.input-with-icon input:focus + .input-icon-left {
    color: var(--primary);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(91, 98, 238, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 98, 238, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert-danger {
    background-color: #fef2f2;
    color: var(--warning-text);
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(220, 38, 38, 0.1);
    display: none;
    text-align: left;
}

/* --- DASHBOARD PAGE STYLING --- */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.app-brand {
    display: flex;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 40px;
}

.brand-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    margin-right: 12px;
    color: white;
}

.brand-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.brand-text-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: inset 4px 0 0 var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #fef2f2;
    color: var(--warning-text);
    border: 1px solid rgba(220, 38, 38, 0.1);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.btn-logout:hover {
    background: var(--warning-bg);
}

/* Content Area */
.app-main {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.header-title-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

.header-title-section p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    padding: 8px 16px 8px 8px;
    border-radius: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* Tabs Content */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

/* Dashboard Widgets Grid */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.widget-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.widget-card.bpm-card::before {
    background: #ef4444;
}

.widget-card.signal-card::before {
    background: #3b82f6;
}

.widget-card.diagnosis-card::before {
    background: #10b981;
}

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

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bpm-card .widget-icon {
    background-color: #fef2f2;
    color: #ef4444;
}

.signal-card .widget-icon {
    background-color: #eff6ff;
    color: #3b82f6;
}

.diagnosis-card .widget-icon {
    background-color: #ecfdf5;
    color: #10b981;
}

.widget-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.widget-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-main);
}

.widget-unit {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

.widget-footer {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.badge-normal {
    background-color: var(--normal-bg);
    color: var(--normal-text);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info-text);
}

/* Dashboard Charts / Analytics */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

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

.chart-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Info Box / Profile card inside dashboard */
.info-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.info-item {
    margin-bottom: 16px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-val {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    text-align: left;
}

.data-table th {
    background-color: var(--background);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border-color);
}

.data-table td {
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* Account Settings Forms */
.settings-wrapper {
    max-width: 600px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section-title svg {
    width: 20px;
    height: 20px;
}

.alert-success {
    background-color: #f0fdf4;
    color: var(--normal-text);
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(22, 163, 74, 0.1);
    display: none;
}

/* Mobile Navigation Bar (hidden by default) */
.mobile-nav {
    display: none;
}

/* Animations */
@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.heart-beating {
    animation: heartBeat 1.2s infinite;
}

/* --- RESPONSIVE LAYOUT (MOBILE) --- */
@media (max-width: 991px) {
    .widgets-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px; /* Space for mobile nav */
    }
    
    .app-sidebar {
        display: none; /* Hide sidebar on mobile */
    }
    
    .app-main {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-user-profile {
        width: 100%;
        justify-content: flex-start;
    }
    
    .widgets-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Bottom Navigation for Mobile */
    .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-top: 1px solid var(--border-color);
        height: 65px;
        z-index: 999;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        flex: 1;
        height: 100%;
        gap: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }
    
    .mobile-nav-item.active {
        color: var(--primary);
    }
    
    .mobile-nav-item.active svg {
        stroke: var(--primary);
    }
    
    .login-container {
        padding: 24px;
        border-radius: 16px;
        box-shadow: none;
        border: none;
        background: transparent;
    }
}
