/* RIVO Template Browser Styles */

.template-browser {
    padding: 24px;
    background: #FAFAFA;
    border-radius: 12px;
    min-height: 600px;
}

.template-header {
    margin-bottom: 24px;
}

.template-header h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #000;
}

.template-subtitle {
    color: #737373;
    font-size: 14px;
    margin: 0;
}

/* Filters */
.template-filters {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Public Sans', sans-serif;
    transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #000;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.no-templates {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #737373;
    font-size: 16px;
}

/* Template Cards */
.template-card {
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    border-color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.template-card-header {
    padding: 16px;
    border-bottom: 1px solid #E5E5E5;
}

.template-card-header h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

.template-protocols {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.protocol-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #F5F5F5;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.template-card-body {
    padding: 16px;
    flex: 1;
}

.template-description {
    font-size: 14px;
    color: #525252;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #FAFAFA;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    font-size: 11px;
    color: #737373;
}

.template-card-footer {
    padding: 12px 16px;
    border-top: 1px solid #E5E5E5;
    display: flex;
    gap: 8px;
    background: #FAFAFA;
}

.template-card-footer button {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Public Sans', sans-serif;
}

.btn-preview {
    background: white;
    color: #000;
}

.btn-preview:hover {
    background: #F5F5F5;
}

.btn-use-template {
    background: #000;
    color: white;
    border-color: #000;
}

.btn-use-template:hover {
    background: #262626;
}

/* Template Preview */
.template-preview {
    background: white;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    max-height: 600px;
    overflow-y: auto;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #E5E5E5;
}

.preview-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.btn-close-preview {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #737373;
    transition: color 0.2s;
}

.btn-close-preview:hover {
    color: #000;
}

.preview-details {
    margin-bottom: 24px;
}

.detail-row {
    padding: 8px 0;
    font-size: 14px;
    color: #525252;
}

.detail-row strong {
    color: #000;
    margin-right: 8px;
}

.detail-row a {
    color: #2563EB;
    text-decoration: none;
}

.detail-row a:hover {
    text-decoration: underline;
}

.preview-yaml {
    background: #F5F5F5;
    padding: 16px;
    border-radius: 8px;
}

.preview-yaml h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-yaml pre {
    margin: 0;
    padding: 16px;
    background: #000;
    color: #22C55E;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.preview-yaml code {
    font-family: 'Space Mono', monospace;
}

/* Decoder Configuration Styles */
.decoder-config {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #E5E5E5;
}

.decoder-note {
    color: #737373;
    font-size: 14px;
    font-style: italic;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Public Sans', sans-serif;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #000;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .template-filters {
        grid-template-columns: 1fr;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }
}