/* Parley Neurotech Brand Colors */
:root {
    --parley-electric-blue: #00A8FF;
    --parley-navy-blue: #1B365D;
    --parley-silver-gray: #8E9AAF;
    --parley-white: #FFFFFF;
    --parley-black: #1a1a1a;
    --error-red: #D32F2F;
    --success-green: #4CAF50;

    /* Role-specific theme colors */
    --theme-patient-primary: #00A8FF;        /* Light/Electric Blue */
    --theme-patient-secondary: #0096E6;
    --theme-patient-bg: #E8F7FF;

    --theme-audiologist-primary: #1B365D;    /* Navy Blue */
    --theme-audiologist-secondary: #2a4a7f;
    --theme-audiologist-bg: #E8ECF2;

    --theme-provider-primary: #8E9AAF;       /* Silver Gray */
    --theme-provider-secondary: #6B7A94;
    --theme-provider-bg: #F5F6F8;

    --theme-admin-primary: #1a1a1a;          /* Black */
    --theme-admin-secondary: #333333;
    --theme-admin-bg: #F0F0F0;

    --theme-superuser-primary: #D32F2F;      /* Red */
    --theme-superuser-secondary: #B71C1C;
    --theme-superuser-bg: #FFEBEE;
}

/* Role-specific body classes */
body.theme-patient {
    --theme-primary: var(--theme-patient-primary);
    --theme-secondary: var(--theme-patient-secondary);
    --theme-bg: var(--theme-patient-bg);
}

body.theme-audiologist {
    --theme-primary: var(--theme-audiologist-primary);
    --theme-secondary: var(--theme-audiologist-secondary);
    --theme-bg: var(--theme-audiologist-bg);
}

body.theme-provider {
    --theme-primary: var(--theme-provider-primary);
    --theme-secondary: var(--theme-provider-secondary);
    --theme-bg: var(--theme-provider-bg);
}

body.theme-admin {
    --theme-primary: var(--theme-admin-primary);
    --theme-secondary: var(--theme-admin-secondary);
    --theme-bg: var(--theme-admin-bg);
}

body.theme-superuser {
    --theme-primary: var(--theme-superuser-primary);
    --theme-secondary: var(--theme-superuser-secondary);
    --theme-bg: var(--theme-superuser-bg);
}

/* Themed header for role-specific styling */
body.theme-patient header { background-color: var(--theme-patient-primary); }
body.theme-audiologist header { background-color: var(--theme-audiologist-primary); }
body.theme-provider header { background-color: var(--theme-provider-primary); color: var(--parley-navy-blue); }
body.theme-admin header { background-color: var(--theme-admin-primary); }
body.theme-superuser header { background-color: var(--theme-superuser-primary); }

/* Provider header needs navy text for contrast with silver background */
body.theme-provider header .user-info { color: var(--parley-navy-blue); }
body.theme-provider header .user-info a { color: var(--parley-navy-blue); }

/* Themed navigation for role-specific styling */
body.theme-patient nav { background-color: var(--theme-patient-secondary); }
body.theme-audiologist nav { background-color: var(--theme-audiologist-secondary); }
body.theme-provider nav { background-color: var(--theme-provider-secondary); }
body.theme-admin nav { background-color: var(--theme-admin-secondary); }
body.theme-superuser nav { background-color: var(--theme-superuser-secondary); }

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

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background-color: var(--parley-white);
    color: var(--parley-navy-blue);
    line-height: 1.6;
}

/* Header */
header {
    background-color: var(--parley-navy-blue);
    color: var(--parley-white);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
}

.user-info {
    font-size: 14px;
}

/* Navigation */
nav {
    background-color: var(--parley-electric-blue);
    padding: 0;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;
    color: var(--parley-white);
    text-decoration: none;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: rgba(0, 0, 0, 0.15);
}

/* Navigation badge for unread counts */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--parley-white);
    color: var(--parley-navy-blue);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    padding: 0 6px;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

/* Login Page Specific */
.login-container {
    max-width: 450px;
    margin: 100px auto;
    padding: 40px;
    background: var(--parley-white);
    border: 1px solid rgba(142, 154, 175, 0.3);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    color: var(--parley-navy-blue);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--parley-silver-gray);
    font-size: 16px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--parley-navy-blue);
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(142, 154, 175, 0.5);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--parley-electric-blue);
    box-shadow: 0 0 0 2px rgba(0, 168, 255, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    min-height: 44px;
    line-height: 20px;
}

.btn-primary {
    background-color: var(--parley-electric-blue);
    color: var(--parley-white);
    width: 100%;
}

.btn-primary:hover {
    background-color: #0096e6;
}

.btn-secondary {
    background-color: var(--parley-white);
    color: var(--parley-navy-blue);
    border: 2px solid var(--parley-navy-blue);
}

.btn-secondary:hover {
    background-color: var(--parley-navy-blue);
    color: var(--parley-white);
}

/* Messages/Alerts */
.messages {
    margin: 24px 0;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--success-green);
    color: #2e7d32;
}

.alert-error {
    background-color: rgba(211, 47, 47, 0.1);
    border: 1px solid var(--error-red);
    color: #c62828;
}

/* Dashboard Welcome Panel */
.welcome-panel {
    background: var(--parley-white);
    border: 1px solid rgba(142, 154, 175, 0.3);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.welcome-panel h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--parley-navy-blue);
    margin-bottom: 8px;
}

.welcome-panel p {
    color: var(--parley-silver-gray);
    font-size: 14px;
    margin: 4px 0;
}

/* Quick Action Cards */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.action-card {
    background: var(--parley-white);
    border: 1px solid rgba(142, 154, 175, 0.3);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.3s;
    cursor: pointer;
}

.action-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--parley-navy-blue);
    margin-bottom: 8px;
}

.action-card p {
    color: var(--parley-silver-gray);
    font-size: 14px;
}

/* Footer */
footer {
    background-color: var(--parley-silver-gray);
    color: var(--parley-white);
    text-align: center;
    padding: 16px;
    font-size: 14px;
    margin-top: 48px;
}

footer a {
    color: var(--parley-white);
    text-decoration: none;
    margin: 0 8px;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive table wrapper - use on parent div of wide tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    header .user-info {
        font-size: 13px;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 4px;
    }

    nav ul li a {
        padding: 8px 12px;
        font-size: 13px;
    }

    .login-container {
        margin: 24px auto;
        padding: 24px;
    }

    /* Make table parent containers scrollable on mobile */
    .table-responsive,
    .container > div:has(> table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}