/* Base styles */
:root {
    --primary-color: #4d798f;
    --secondary-color: #003f5f;
    --accent-color: #4CAF50;
    --text-color: #333;
    --light-text: #666;
    --background-color: #f5f5f5;
    --card-background: #fff;
    --border-color: #ddd;
    --status-valid: #4CAF50;
    --status-expired: #FF9800;
    --status-revoked: #F44336;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header styles */
header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

header h1 {
    margin-bottom: 10px;
}

.commit-id {
    font-family: monospace;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Main content styles */
main {
    padding: 30px;
}

.details-card {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 40px;
    gap: 30px;
}

.badges-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.badge-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.badge-preview h3, .certificate-preview h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.certificate-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.details-info {
    flex: 2;
    min-width: 300px;
}

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

table th, table td {
    padding: 2px 1px;
    text-align: left;

}

/* Remove horizontal lines in details-info */
.details-info table th, .details-info table td {
    border-bottom: none;
}

table th {
    width: 30%;
    color: var(--light-text);
}

/* Prevent label wrapping in details table */
.details-info table th {
    white-space: nowrap;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

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

.status-expired {
    background-color: var(--status-expired);
}

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

/* Integration section */
.integration-info {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.integration-info h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

pre {
    background-color: #f1f1f1;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    border: 1px solid #e0e0e0;
}

code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Footer styles */
footer {
    background-color: #f1f1f1;
    padding: 20px;
    text-align: center;
    color: var(--light-text);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* Badges list styles */
.badges-list {
    margin-bottom: 30px;
}

.badges-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badges-table thead {
    background-color: #f1f1f1;
}

.badges-table th {
    font-weight: bold;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid var(--border-color);
    width: auto;
}

.badges-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.badges-table tr:hover {
    background-color: #f9f9f9;
}

.badges-table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.badges-table a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .details-card {
        flex-direction: column;
    }

    .badges-container, .details-info {
        width: 100%;
    }

    .badge-preview, .certificate-preview {
        width: 100%;
    }

    table th {
        width: 40%;
    }

    .badges-table thead {
        display: none;
    }

    .badges-table, .badges-table tbody, .badges-table tr, .badges-table td {
        display: block;
        width: 100%;
    }

    .badges-table tr {
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }

    .badges-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid var(--border-color);
    }

    .badges-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    header, main, footer {
        padding: 15px;
    }

    table th, table td {
        padding: 8px 10px;
    }

    table th {
        width: 50%;
    }
}


/* Ensure values in details table can wrap across multiple lines */
.details-info table td {
    white-space: normal;         /* allow wrapping */
    overflow-wrap: anywhere;     /* break long words/URLs if needed */
    word-break: break-word;      /* legacy support for long tokens */
    vertical-align: top;         /* align label and multi-line value nicely */
}
