:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0 4rem;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0 3rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step-number {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-line {
    width: 4rem;
    height: 3px;
    background: var(--border-color);
    margin: 0 1rem;
}

/* Panels Container */
.panels-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.panel {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-badge.issuer {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.role-badge.holder {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.role-badge.verifier {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.panel-body {
    padding: 1.5rem;
    min-height: 400px;
}

/* Step Sections */
.step-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px dashed var(--border-color);
}

.step-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Schema Preview */
.schema-preview {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.schema-field {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.schema-field:last-child {
    margin-bottom: 0;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[readonly] {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.full-width {
    width: 100%;
}

.button-group {
    display: flex;
    gap: 0.75rem;
}

.button-group .btn {
    flex: 1;
}

/* QR Code */
.qr-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    text-align: center;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 1rem auto;
    background: white;
    border: 4px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: var(--shadow-md);
}

/* Status Messages */
.status-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.status-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Wallet States */
.wallet-screen,
.verifier-screen {
    min-height: 400px;
}

.wallet-state,
.verifier-state {
    display: none;
}

.wallet-state.active,
.verifier-state.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

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

/* Notifications */
.notification {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.notification strong {
    display: block;
    margin-bottom: 0.25rem;
}

.notification p {
    font-size: 0.875rem;
    margin: 0;
}

.notification.success {
    background: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.notification.info {
    background: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

.notification.warning {
    background: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.notification.error {
    background: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.notification.large {
    padding: 1.5rem;
    text-align: center;
    font-size: 1.125rem;
}

/* Credential Cards */
.credential-preview,
.credential-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.credential-card {
    box-shadow: var(--shadow-md);
}

.credential-card.revoked {
    border-color: var(--danger-color);
    opacity: 0.7;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header h4 {
    margin: 0;
    font-size: 1.125rem;
}

.credential-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.credential-status.valid {
    background: var(--success-color);
    color: white;
}

.credential-status.revoked {
    background: var(--danger-color);
    color: white;
}

.credential-field {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.credential-field:last-child {
    border-bottom: none;
}

.field-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.field-value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Proof Request */
.proof-request-details {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.proof-request-details h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.proof-request-details ul {
    list-style: none;
    padding: 0;
}

.proof-request-details li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

/* Verifier */
.login-prompt {
    text-align: center;
    padding: 2rem 1rem;
}

.login-prompt h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.proof-requirements {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.proof-requirements h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.proof-requirements ul {
    list-style: none;
    padding: 0;
}

.proof-requirements li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.verified-info {
    text-align: center;
    padding: 1rem;
}

.verified-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--success-color);
}

.verified-details {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.success-text {
    color: var(--success-color) !important;
}

.access-granted {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 1.5rem;
}

.access-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.access-granted h4 {
    font-size: 1.25rem;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.access-granted p {
    color: #065f46;
}

/* Spinner */
.spinner-container {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

/* Event Log */
.event-log-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.event-log-header {
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
}

.event-log-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.event-log {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border-left: 4px solid;
}

.log-entry:last-child {
    margin-bottom: 0;
}

.log-time {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.log-message {
    flex: 1;
}

.log-entry.info {
    background: #dbeafe;
    border-color: var(--info-color);
}

.log-entry.success {
    background: #d1fae5;
    border-color: var(--success-color);
}

.log-entry.warning {
    background: #fef3c7;
    border-color: var(--warning-color);
}

.log-entry.error {
    background: #fee2e2;
    border-color: var(--danger-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.modal-body ol,
.modal-body ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: var(--success-color);
}

.toast.error {
    border-color: var(--danger-color);
}

.toast.info {
    border-color: var(--info-color);
}

.toast.warning {
    border-color: var(--warning-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .panels-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }

    .progress-container {
        overflow-x: auto;
    }

    .progress-line {
        width: 2rem;
        margin: 0 0.5rem;
    }

    .step-number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .panels-container {
        gap: 1rem;
    }

    .panel-body {
        padding: 1rem;
    }

    .button-group {
        flex-direction: column;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
    }

    .toast {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .modal-content {
        max-height: 95vh;
    }
}
