/* Reusable component styles */

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: #495057;
    color: white;
    border: 1px solid #495057;
}

.btn-primary:hover {
    background: #343a40;
    border-color: #343a40;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

.btn-success {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-success:hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* Copy button */
.copy-icon-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 300;
    color: #6c757d;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-icon-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #495057;
    color: #495057;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.copy-icon-btn:active {
    transform: scale(0.95) translateY(0);
}

/* Copy image link */
.copy-image-link {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.copy-image-link:hover {
    color: #495057;
    text-decoration: underline;
}

/* Monaco Editor */
.code-editor {
    width: 100%;
    height: 100%;
    min-height: 200px; /* Add minimum height */
    max-height: 100%;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fafbfc;
    transition: border-color 0.2s ease;
    overflow: hidden;
}

.code-editor:focus-within {
    border-color: #6c757d;
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.1);
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Mermaid diagrams */
.mermaid {
    text-align: center;
}

/* Tab styles */
.tab-container {
    display: flex;
    gap: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #495057;
    background: rgba(108, 117, 125, 0.1);
}

.tab-btn.active {
    color: #495057;
    border-bottom-color: #495057;
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* Preview controls */
.preview-controls {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.preview-mode-btn {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-mode-btn:hover {
    background: #f8f9fa;
    border-color: #495057;
    color: #495057;
}

.preview-mode-btn.active {
    background: #495057;
    border-color: #495057;
    color: white;
}

.preview-mode-btn:active {
    transform: scale(0.95);
}

/* Error boundary styles */
.error-boundary {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 15px;
    max-width: 400px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.error-boundary .error-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.error-boundary .error-message {
    margin-bottom: 10px;
    font-size: 14px;
}

.error-boundary .error-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #721c24;
}

.error-fallback {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    color: #6c757d;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.error-fallback__icon {
    font-size: 18px;
    margin-bottom: 10px;
}

.error-fallback__title {
    font-weight: bold;
    margin-bottom: 5px;
}

.error-fallback__message {
    font-size: 14px;
}

/* App initialization error styles */
.init-error {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.init-error__container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.init-error__title {
    color: #dc3545;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.init-error__message {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.init-error__list {
    text-align: left;
    color: #666;
    margin-bottom: 25px;
    padding-left: 20px;
}

.init-error__list li {
    margin-bottom: 8px;
    font-size: 14px;
}

.init-error__button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 10px;
    transition: background-color 0.2s ease;
}

.init-error__button:hover {
    background: #0056b3;
}

.init-error__button--secondary {
    background: #6c757d;
    margin-right: 0;
}

.init-error__button--secondary:hover {
    background: #545b62;
}
