* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 300px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.logo {
    padding: 0;
    background-color: #34495e;
    border-bottom: 2px solid #1abc9c;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1abc9c;
}

.menu {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar personalizada para el menú */
.menu::-webkit-scrollbar {
    width: 8px;
}

.menu::-webkit-scrollbar-track {
    background: #2c3e50;
}

.menu::-webkit-scrollbar-thumb {
    background: #1abc9c;
    border-radius: 4px;
}

.menu::-webkit-scrollbar-thumb:hover {
    background: #16a085;
}

.menu-footer {
    background-color: #2c3e50;
    border-top: 2px solid #1abc9c;
    padding: 0;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background-color: #34495e;
    border-left-color: #1abc9c;
}

.menu-item.active {
    background-color: #34495e;
    border-left-color: #1abc9c;
    font-weight: 600;
}

.menu-icon {
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.menu-text {
    font-size: 14px;
    line-height: 1.3;
}

/* Main Content Styles */
.content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background-color: #ffffff;
}

.tool-section {
    display: none;
    max-width: 900px;
    margin: 0 auto;
}

.tool-section.active {
    display: block;
}

.tool-section h2 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.description {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 30px;
    line-height: 1.8;
}

/* Input Section */
.input-section {
    margin-bottom: 20px;
}

.input-section label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.cert-type-selector {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.cert-type-selector:focus {
    outline: none;
    border-color: #1abc9c;
}

.input-section textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.input-section textarea:focus {
    outline: none;
    border-color: #1abc9c;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.btn-primary, .btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #1abc9c;
    color: white;
}

.btn-primary:hover {
    background-color: #16a085;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Output Section */
.output-section {
    margin-top: 30px;
}

.output-section h3 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.output-box {
    margin-bottom: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #ecf0f1;
    border-bottom: 2px solid #e0e0e0;
}

.output-header span {
    font-weight: 600;
    color: #2c3e50;
}

.btn-copy {
    padding: 6px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-copy:hover {
    background-color: #2980b9;
}

.output-box textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background-color: #f9f9f9;
}

/* Error Message */
.error-message {
    padding: 15px;
    background-color: #e74c3c;
    color: white;
    border-radius: 5px;
    margin-top: 15px;
    font-weight: 600;
}

/* Warning Box */
.warning-box {
    padding: 15px;
    background-color: #f39c12;
    color: white;
    border-radius: 5px;
    margin-top: 20px;
    font-weight: 500;
    line-height: 1.6;
}

/* Info Box */
.info-box {
    padding: 15px;
    background-color: #3498db;
    color: white;
    border-radius: 5px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.info-box code {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* CSR Form */
.csr-form {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    flex: 1 1 100%;
}

.form-group label {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1abc9c;
}

.form-group small {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 4px;
}

/* Parse Output */
.parse-output {
    background-color: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
}

.parse-output .section-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #1abc9c;
}

.parse-output .section-title:first-child {
    margin-top: 0;
}

.parse-output .field {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
}

.parse-output .field-label {
    font-weight: 600;
    color: #34495e;
    min-width: 200px;
    margin-right: 10px;
}

.parse-output .field-value {
    color: #555;
    flex: 1;
    word-break: break-all;
}

.parse-output .field-value.multiline {
    display: block;
    margin-top: 5px;
    margin-left: 0;
    padding-left: 10px;
    border-left: 3px solid #1abc9c;
}

/* Form Section (for P12 Generator) */
.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.form-section .form-group {
    margin-bottom: 20px;
}

.form-section .form-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-section .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.form-section .form-group textarea:focus {
    outline: none;
    border-color: #1abc9c;
}

.form-section .form-group input[type="password"],
.form-section .form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s ease;
}

.form-section .form-group input:focus {
    outline: none;
    border-color: #1abc9c;
}

.form-section .form-group small {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Success Message */
.success-message {
    padding: 20px;
    background-color: #27ae60;
    color: white;
    border-radius: 5px;
    text-align: center;
}

.success-message p {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 500;
}

.success-message .btn-primary {
    background-color: #2c3e50;
    padding: 12px 30px;
}

.success-message .btn-primary:hover {
    background-color: #34495e;
}

/* Certificate Parser Output Styles */
.info-section {
    background-color: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-section h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1abc9c;
    font-weight: 600;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #34495e;
    min-width: 220px;
    padding-right: 15px;
    font-size: 14px;
}

.info-value {
    color: #555;
    flex: 1;
    word-break: break-word;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

/* Indicadores de seguridad: colorear toda la línea */
.info-row.sec-good {
    background-color: #e8f5e9; /* verde claro */
    border-left: 4px solid #2e7d32;
    padding-left: 12px;
    border-radius: 4px;
}
.info-row.sec-bad {
    background-color: #ffebee; /* rojo claro */
    border-left: 4px solid #c62828;
    padding-left: 12px;
    border-radius: 4px;
}
.info-row.sec-neutral {
    background-color: #f5f5f5; /* gris claro */
    border-left: 4px solid #9e9e9e;
    padding-left: 12px;
    border-radius: 4px;
}

.extension-item {
    margin-bottom: 15px;
    padding: 12px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.extension-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 8px;
}

.extension-value {
    color: #555;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    padding-left: 10px;
    border-left: 3px solid #1abc9c;
}

/* Scrollbar Styles */
.content::-webkit-scrollbar {
    width: 10px;
}

.content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.content::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 5px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Pair Verification Styles */
.verification-result {
    margin-bottom: 25px;
}

.result-box {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.result-box.success {
    background-color: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.result-box.error {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

.result-icon {
    font-size: 48px;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
}

.result-box.success .result-icon {
    color: #28a745;
}

.result-box.error .result-icon {
    color: #dc3545;
}

.result-text strong {
    font-size: 20px;
    display: block;
    margin-bottom: 8px;
}

.result-text p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.hash-comparison {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.hash-comparison h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.hash-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hash-item {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.hash-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.hash-value {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    word-break: break-all;
    line-height: 1.6;
}

.hash-value.match {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.hash-value.no-match {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}
