/* Custom styles for CV Ombouwer */

/* Tooltip styles */
.tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: #e5e7eb;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    cursor: help;
    margin-left: 4px;
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    width: 250px;
    text-align: left;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    line-height: 1.4;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

/* Upload zone drag state */
.upload-zone.drag-over {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.upload-zone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #0550ae;
}

.json-string {
    color: #0a3069;
}

.json-number {
    color: #0550ae;
}

.json-boolean {
    color: #cf222e;
}

.json-null {
    color: #6e7781;
}

.json-bracket {
    color: #24292f;
}

.json-colon {
    color: #24292f;
}

.json-comma {
    color: #24292f;
}

/* Dark theme for JSON in config */
#configJson {
    background-color: #f6f8fa;
    min-height: 100px;
}

#configJson .json-key {
    color: #0550ae;
}

#configJson .json-string {
    color: #0a3069;
}

#configJson .json-number {
    color: #0550ae;
}

#configJson .json-boolean {
    color: #cf222e;
}

#configJson .json-null {
    color: #6e7781;
}

/* JSON Preview styling */
#jsonCode {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-radius: 0;
}

#jsonCode .json-key {
    color: #9cdcfe;
}

#jsonCode .json-string {
    color: #ce9178;
}

#jsonCode .json-number {
    color: #b5cea8;
}

#jsonCode .json-boolean {
    color: #569cd6;
}

#jsonCode .json-null {
    color: #569cd6;
}

#jsonCode .json-bracket {
    color: #ffd700;
}

/* Modal backdrop blur */
#modalBackdrop {
    backdrop-filter: blur(2px);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Toast animation */
#toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* File input focus styles */
input[type="file"]:focus + label {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Textarea resize */
textarea {
    resize: vertical;
    min-height: 200px;
}

/* Pre tag word wrap */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Button disabled state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Select styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Transition for collapsible sections */
#jsonContent {
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.3s ease-out;
}

#jsonContent.expanded {
    max-height: 500px;
}

/* Config JSON editor */
#jsonEditor {
    position: relative;
}

#jsonEditor::after {
    content: 'JSON';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
