/* DID Demo - Simple Auth-based UI */

:root {
    --primary: #2F325E;
    --primary-light: #4a4d7c;
    --secondary: #1976d2;
    --success: #388e3c;
    --warning: #f57c00;
    --error: #d32f2f;
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

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

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.header-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.2s;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.1);
}

.header-nav a.active {
    background: rgba(255,255,255,0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

.logout-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

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

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-group input[readonly] {
    background: #f5f5f5;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-primary:disabled {
    background: #90caf9;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--primary);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary-light);
}

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

.btn-success:hover {
    background: #2e7d32;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: #f5f5f5;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon.vc { background: #e8f5e9; }
.feature-icon.vp { background: #fff3e0; }
.feature-icon.wallet { background: #e3f2fd; }

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-light);
}

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

.alert-error {
    background: #ffebee;
    border-left: 4px solid var(--error);
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    border-left: 4px solid var(--success);
    color: #2e7d32;
}

.alert-info {
    background: #e3f2fd;
    border-left: 4px solid var(--secondary);
    color: #1565c0;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text);
    background: #f5f5f5;
}

td {
    color: var(--text-light);
}

tr:hover td {
    background: #fafafa;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e8f5e9;
    color: var(--success);
}

.badge-warning {
    background: #fff3e0;
    color: var(--warning);
}

.badge-info {
    background: #e3f2fd;
    color: var(--secondary);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--primary);
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 14px;
}

.auth-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
}

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

/* VC/VP specific */
.vc-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid var(--success);
}

.vc-item h4 {
    font-weight: 600;
    margin-bottom: 8px;
}

.vc-item .meta {
    font-size: 13px;
    color: var(--text-light);
}

.vc-item .actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

/* Result display */
.result-box {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.result-box pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Language Switcher */
.lang-switcher {
    text-align: right;
    margin-bottom: 20px;
}

.lang-switcher a {
    color: var(--text-light);
    text-decoration: none;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 500;
}

.lang-switcher a:hover {
    color: var(--secondary);
}

.lang-switcher a.active {
    color: var(--secondary);
    font-weight: 600;
}

.lang-switcher span {
    color: var(--border);
    margin: 0 4px;
}

.lang-switcher-header {
    display: flex;
    align-items: center;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,0.3);
}

.lang-switcher-header a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 500;
}

.lang-switcher-header a:hover {
    color: white;
}

.lang-switcher-header a.active {
    color: white;
    font-weight: 600;
}

.lang-switcher-header span {
    color: rgba(255,255,255,0.5);
    margin: 0 2px;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }
