/* PulseCore Variable Details Styles - Based on admin.css */

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

body {
    font-family: 'Segoe UI', 'Monaco', 'Cascadia Code', system-ui, monospace;
    background: #0a0e1a;
    color: #e2e8f0;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.details-container {
    min-height: 100vh;
    background: 
        radial-gradient(circle at 25% 25%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #0a0e1a 0%, #1a1b2e 25%, #16213e 50%, #0f3460 75%, #0a0e1a 100%);
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* Header */
.details-header {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1.5rem 1.5rem 0 0;
    backdrop-filter: blur(25px);
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.details-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 20%, #ec4899 40%, #06b6d4 60%, #10b981 80%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(124, 58, 237, 0.6);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-back, .btn-edit, .btn-export, .btn-save, .btn-cancel {
    padding: 0.75rem 1.5rem;
    border: 1px solid;
    border-radius: 0.75rem;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-decoration: none;
    display: inline-block;
    background: none;
    font-size: 0.9rem;
}

.btn-back {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
}

.btn-edit {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(124, 58, 237, 0.9));
    border-color: rgba(168, 85, 247, 0.5);
    color: white;
}

.btn-export {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.8), rgba(8, 145, 178, 0.9));
    border-color: rgba(6, 182, 212, 0.5);
    color: white;
}

.btn-save {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.8), rgba(5, 150, 105, 0.9));
    border-color: rgba(16, 185, 129, 0.5);
    color: white;
}

.btn-cancel {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.9));
    border-color: rgba(239, 68, 68, 0.5);
    color: white;
}

.btn-back:hover, .btn-edit:hover, .btn-export:hover, .btn-save:hover, .btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-back:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #a855f7;
}

/* Content */
.details-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 0 0 1.5rem 1.5rem;
    backdrop-filter: blur(25px);
    padding: 2rem;
    border-top: none;
}

/* Primary Card */
.primary-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.primary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.05), rgba(6, 182, 212, 0.05));
    pointer-events: none;
}

.symbol-display {
	min-width: 100px;
    min-height: 100px;
	max-width: 60%;
	padding: 5px 25px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(168, 85, 247, 0.2));
    border: 2px solid rgba(168, 85, 247, 0.4);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
    position: relative;
    z-index: 1;
}

.symbol-text {
    font-size: 3rem;
    font-weight: 800;
    color: #e2e8f0;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
    font-family: 'Monaco', 'Cascadia Code', monospace;
	text-align: center;
}

.primary-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.variable-name {
    font-size: 2rem;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.variable-long-form {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.value-section {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.value-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.value-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.value-content {
    font-size: 1.2rem;
    font-weight: 700;
    color: #06b6d4;
    font-family: 'Monaco', 'Cascadia Code', monospace;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.primary-badges {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    border: 1px solid;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.badge-quality {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #a855f7;
}

.badge-category {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.4);
    color: #06b6d4;
}

.badge-complexity {
    background: rgba(236, 72, 153, 0.2);
    border-color: rgba(236, 72, 153, 0.4);
    color: #ec4899;
}

.badge-fundamental {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.detail-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.detail-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #a855f7;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(168, 85, 247, 0.3);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.property-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.property-item:last-child {
    border-bottom: none;
}

.property-label {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.9rem;
    min-width: 120px;
}

.property-value {
    color: #e2e8f0;
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.code-style {
    font-family: 'Monaco', 'Cascadia Code', monospace;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #06b6d4;
}

.badge-like {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #a855f7;
    font-family: 'Monaco', 'Cascadia Code', monospace;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.checkbox-status {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.checkbox-label {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Text Content Section */
.text-content-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
	margin-bottom: 25px;
}

.text-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.text-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.text-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #a855f7;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.text-content {
    color: #e2e8f0;
    line-height: 1.7;
    font-size: 0.95rem;
}

.code-block {
    font-family: 'Monaco', 'Cascadia Code', monospace;
    background: rgba(15, 23, 42, 0.8);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    white-space: pre-wrap;
    overflow-x: auto;
    color: #06b6d4;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
    color: #e2e8f0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(168, 85, 247, 0.2);
    border-top: 4px solid #a855f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #94a3b8;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.9));
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 1.5rem;
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
}

.modal-header h2 {
    color: #e2e8f0;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    color: #e2e8f0;
    line-height: 1.6;
}

/* Edit Mode Styles */
.editable-field {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: #e2e8f0;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    transition: border-color 0.3s ease;
}

.editable-field:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.editable-textarea {
    min-height: 100px;
    resize: vertical;
}

.editable-select {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: #e2e8f0;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
}

.edit-mode .text-content,
.edit-mode .property-value {
    transition: all 0.3s ease;
}

/* Function Edit Panel */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    margin: 0;
}

.btn-function-edit {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.9));
    border: 1px solid rgba(34, 197, 94, 0.5);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-function-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.function-edit-panel {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.function-editor {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.function-editor h4 {
    margin: 0 0 1rem 0;
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
}

.argument-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.argument-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
}

.argument-row select {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem;
    color: #e2e8f0;
    font-family: inherit;
    font-size: inherit;
}

.argument-row select:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.btn-remove-row {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.9));
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 0.375rem;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.argument-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-add-arg, .btn-clear-args {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid;
}

.btn-add-arg {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.9));
    border-color: rgba(59, 130, 246, 0.5);
    color: white;
}

.btn-clear-args {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.9));
    border-color: rgba(239, 68, 68, 0.5);
    color: white;
}

.btn-add-arg:hover, .btn-clear-args:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .details-container {
        border-radius: 0;
    }
    
    .details-header {
        border-radius: 0;
        padding: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .details-header h1 {
        font-size: 2rem;
    }
    
    .details-content {
        padding: 1.5rem;
        border-radius: 0;
    }
    
    .primary-card {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .value-section {
        justify-content: center;
    }
    
    .primary-badges {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .text-content-section {
        grid-template-columns: 1fr;
    }
    
    .property-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .property-value {
        text-align: left;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
/* Usage statistics in edit mode: the number stays big and centred, in a box
   narrow enough to sit inside its stat tile (2026-09-25). */
.editable-field.editable-stat {
    width: 100%;
    max-width: 9ch;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #a855f7;
    font-family: 'Monaco', 'Cascadia Code', monospace;
    -moz-appearance: textfield;
}
.editable-field.editable-stat::-webkit-outer-spin-button,
.editable-field.editable-stat::-webkit-inner-spin-button { margin: 0; }
