/* LearnPower Portal - Modern Design System */

/* Import IBM Plex fonts */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* Colors from pvDesign */
    --ink: #0c0e12;
    --panel: #141820;
    --raised: #1b212c;
    --line: #2a3140;
    --text: #e8eaef;
    --muted: #8b93a7;
    --accent: #3dcc8c;
    --danger: #e05a5a;
    --amber: #e8a838;
    
    /* Spacing */
    --radius: 6px;
    --radius-lg: 8px;
}

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

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    background: var(--ink);
    color: var(--text);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.125rem;
}

/* Layout */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.topbar {
    background: var(--panel);
    border-top: 2px solid var(--accent);
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
}

.topbar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.brand {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
    line-height: 1;
    position: relative;
}

.brand::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 12px;
    background: var(--accent);
    border-radius: 1px;
}

.brand-subtitle {
    font-size: 0.6875rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
}

.topbar nav .user-email {
    color: var(--muted);
    font-size: 0.6875rem;
    font-family: 'IBM Plex Mono', monospace;
}

.topbar nav a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.topbar nav a:hover {
    color: var(--text);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--raised);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.15s ease;
    letter-spacing: -0.01em;
}

.btn:hover {
    background: var(--line);
    border-color: var(--muted);
}

.btn-primary {
    background: var(--accent);
    color: var(--ink);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: #35b67a;
    border-color: #35b67a;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    padding: 0.25rem 0.625rem;
}

.btn-ghost:hover {
    background: transparent;
    border-color: transparent;
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #c74848;
    border-color: #c74848;
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
}

/* Forms */
label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text);
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.checks {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.checks label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

/* Alerts */
.alert-error {
    background: var(--raised);
    border: 1px solid var(--danger);
    border-left-width: 3px;
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 360px;
}

.login-card .brand-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .brand-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.login-card .brand-tagline {
    font-size: 0.875rem;
    color: var(--muted);
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-card form > div {
    display: flex;
    flex-direction: column;
}

/* Home Page */
.page-intro {
    max-width: 680px;
    margin: 3rem auto 2.5rem;
    padding: 0 1.5rem;
}

.page-intro h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: -0.03em;
}

.page-intro p {
    font-size: 0.9375rem;
    color: var(--muted);
    line-height: 1.6;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.app-panel {
    position: relative;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2rem 1.75rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.app-panel:hover {
    border-color: var(--accent);
}

.app-panel:hover .app-icon {
    opacity: 0.3;
}

.app-icon {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    opacity: 0.15;
    transition: opacity 0.2s ease;
    width: 120px;
    height: 120px;
}

.app-panel h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    position: relative;
    z-index: 1;
}

.app-panel .app-description {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: auto;
    position: relative;
    z-index: 1;
}

.app-panel .app-action {
    font-size: 0.8125rem;
    color: var(--muted);
    margin-top: 1.5rem;
    font-family: 'IBM Plex Mono', monospace;
    position: relative;
    z-index: 1;
}

.app-panel:hover .app-action {
    color: var(--accent);
}

/* SVG Icons */
.icon-pvdesign {
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
}

.icon-sllr {
    stroke: var(--muted);
    fill: none;
    stroke-width: 1.5;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 2rem 0 1.5rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.tile {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.tile h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.tile p {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

.empty-state {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 3rem 1.5rem;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

.empty-state p {
    color: var(--muted);
    font-size: 0.875rem;
}

/* Admin Users Page */
.card {
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.password-field-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.password-field-wrap input {
    flex: 1;
}

.password-field-wrap .btn {
    flex-shrink: 0;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
}

thead {
    background: var(--ink);
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--raised);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--raised);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.badge-admin {
    background: var(--accent);
    color: var(--ink);
    border-color: var(--accent);
}

.inline-form {
    display: inline;
}

/* Responsive */
@media (max-width: 768px) {
    .page-intro {
        margin: 2rem auto 1.5rem;
        padding: 0 1rem;
    }
    
    .page-intro h1 {
        font-size: 1.5rem;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem 2rem;
    }
    
    .app-panel {
        min-height: 160px;
        padding: 1.5rem 1.25rem;
    }
    
    .app-icon {
        width: 100px;
        height: 100px;
        right: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .topbar {
        padding: 0.875rem 0;
    }
    
    .topbar .wrap {
        gap: 1rem;
    }
    
    .topbar nav {
        gap: 0.875rem;
        font-size: 0.8125rem;
    }
    
    .topbar nav .user-email {
        display: none;
    }
}
