/* HID Global Brand Colors */
:root {
    --hid-dark-blue: #002D56;
    --hid-blue: #003087;
    --hid-medium-blue: #0057B7;
    --hid-light-blue: #93C2F8;
    --hid-white: #FFFFFF;
    --hid-light-gray: #F5F7FA;
    --hid-gray: #E0E6ED;
    --hid-dark-gray: #7A8A99;
    --hid-text: #1A2332;
    --success: #28A745;
    --error: #DC3545;
    --warning: #FFC107;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--hid-blue) 0%, var(--hid-medium-blue) 100%);
    color: var(--hid-text);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    position: relative;
    text-align: center;
    color: var(--hid-white);
    margin-bottom: 40px;
    padding: 30px 0;
}

header h1 {
    font-size: 3em;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

header h2 {
    font-size: 1.5em;
    font-weight: 400;
    opacity: 0.95;
}

.main-content {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Make didactic cards span full width for better readability */
    #serverStorageCard,
    #authenticatorStorageCard,
    #comparisonCard,
    #attestationEducationCard,
    #platformCrossplatformCard {
        grid-column: 1 / -1;
    }
}

.card {
    background: var(--hid-white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: var(--hid-blue);
    font-size: 1.5em;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--hid-medium-blue);
    padding-bottom: 10px;
}

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

.form-group label {
    display: block;
    color: var(--hid-dark-blue);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
}

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

.form-group input:focus {
    outline: none;
    border-color: var(--hid-medium-blue);
    box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.1);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

.btn-primary:hover {
    background: var(--hid-blue);
}

.btn-secondary {
    background: var(--hid-dark-blue);
    color: var(--hid-white);
}

.btn-secondary:hover {
    background: #001a33;
}

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

.icon {
    font-size: 1.2em;
}

.status-message {
    padding: 16px;
    border-radius: 8px;
    background: var(--hid-light-gray);
    border-left: 4px solid var(--hid-medium-blue);
    font-size: 0.95em;
}

.status-message.success {
    background: #d4edda;
    border-left-color: var(--success);
    color: #155724;
}

.status-message.error {
    background: #f8d7da;
    border-left-color: var(--error);
    color: #721c24;
}

.status-message.warning {
    background: #fff3cd;
    border-left-color: var(--warning);
    color: #856404;
}

.info-display {
    background: var(--hid-light-gray);
    border-radius: 8px;
    padding: 20px;
}

.info-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hid-gray);
}

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

.info-label {
    font-weight: 700;
    color: var(--hid-blue);
    margin-bottom: 6px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--hid-text);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    background: var(--hid-white);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9em;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--hid-light-blue);
    color: var(--hid-dark-blue);
}

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

.badge-info {
    background: var(--hid-medium-blue);
    color: white;
}

footer {
    text-align: center;
    color: var(--hid-white);
    margin-top: 40px;
    padding: 20px;
    opacity: 0.9;
}

footer p {
    font-size: 0.9em;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Educational Tooltips */
.tooltip-trigger {
    position: relative;
    cursor: help;
}

.tooltip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--hid-medium-blue);
    color: var(--hid-white);
    border-radius: 50%;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
    transition: all 0.2s;
}

.tooltip-trigger:hover .tooltip-icon {
    background: var(--hid-dark-blue);
    transform: scale(1.1);
}

.edu-tooltip {
    position: fixed;
    background: var(--hid-dark-blue);
    color: var(--hid-white);
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 0.9em;
    line-height: 1.6;
    max-width: 400px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--hid-medium-blue);
    animation: tooltipFadeIn 0.2s ease-out;
}

.edu-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: var(--hid-medium-blue);
}

.edu-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--hid-dark-blue);
    margin-bottom: -2px;
}

.edu-tooltip strong {
    color: var(--hid-light-blue);
    display: block;
    margin-bottom: 8px;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-95%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-100%);
    }
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--hid-white);
    border: 2px solid var(--hid-white);
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
    background: var(--hid-white);
    color: var(--hid-blue);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    header h2 {
        font-size: 1.2em;
    }

    .card {
        padding: 20px;
    }

    .edu-tooltip {
        max-width: 280px;
        font-size: 0.85em;
        padding: 12px 16px;
    }

    .language-selector {
        position: static;
        justify-content: center;
        margin-top: 16px;
    }
}
