/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.header-content {
    color: white;
    position: relative;
}

.header-actions {
    position: absolute;
    top: 0;
    right: 0;
}

.language-selector {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 0.5rem;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.language-selector option {
    background: #667eea;
    color: white;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.logo i {
    margin-right: 1rem;
    color: #4ade80;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Panel Base Styles */
.input-panel,
.visualization-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.panel-header i {
    margin-right: 0.5rem;
    color: #4ade80;
}

/* Input Panel */
.input-panel {
    height: fit-content;
}

.input-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-icon {
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    width: 100%;
    font-size: 0.95rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.btn-icon {
    background: transparent;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Items List */
.items-list {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.items-list h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #374151;
}

.items-container {
    max-height: 300px;
    overflow-y: auto;
}

.item-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.item-card:hover {
    background: #f3f4f6;
    border-color: #6366f1;
}

.item-label {
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 0.25rem;
}

.item-description {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Quick Search Section */
.quick-search-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.search-header h3 {
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 1rem;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
}

.search-form input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-btn {
    white-space: nowrap;
    padding: 0.75rem 1.25rem;
}

.search-results {
    margin-top: 1rem;
}

.search-results h4 {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 0.75rem;
}

.recommendations-container {
    max-height: 300px;
    overflow-y: auto;
}

.recommendation-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.recommendation-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.recommendation-title {
    font-weight: 600;
    color: #6366f1;
    font-size: 0.95rem;
}

.recommendation-score {
    font-size: 0.85rem;
    color: #10b981;
    font-weight: 600;
}

.recommendation-category {
    display: inline-block;
    background: #e0e7ff;
    color: #6366f1;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.recommendation-description {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

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

.add-recommendation-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-recommendation-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.perspective-mini-bars {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.mini-bar {
    width: 3px;
    height: 12px;
    background: #e5e7eb;
    border-radius: 2px;
}

.mini-bar.filled {
    background: #6366f1;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.action-buttons .btn-secondary {
    flex: 1;
}

/* Visualization Panel */
.visualization-panel {
    min-height: 600px;
}

.controls {
    display: flex;
    gap: 0.5rem;
}

.visualization-container {
    position: relative;
    height: 500px;
    background: #f9fafb;
}

.visualization-svg {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.loading-state,
.empty-visualization {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6b7280;
}

.loading-state {
    display: none;
}

.loading-state.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.empty-visualization i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Vector Points */
.vector-point {
    cursor: pointer;
    transition: all 0.2s ease;
}

.vector-point:hover {
    filter: brightness(1.2);
    transform: scale(1.2);
}

.vector-point.selected {
    stroke: #6366f1;
    stroke-width: 3;
    filter: brightness(1.3);
}

.vector-label {
    font-size: 12px;
    font-weight: 500;
    fill: #374151;
    text-anchor: middle;
    pointer-events: none;
    text-shadow: 0 0 3px white;
}

/* Details Panel */
.details-panel {
    background: white;
    border-top: 1px solid #e5e7eb;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.details-panel.open {
    max-height: 300px;
}

/* Comparison Panel */
.comparison-panel {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem;
    display: none;
}

.comparison-panel.open {
    display: block;
}

.comparison-panel .panel-header {
    background: none;
    color: #374151;
    padding: 0 0 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.comparison-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.perspectives-container h4 {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 1rem;
}

.perspective-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.perspective-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.perspective-label {
    min-width: 80px;
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.bar-container {
    flex: 1;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.bar-value {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
}

.perspective-score {
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.details-header {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.details-header h3 {
    font-size: 1.1rem;
    color: #374151;
}

.details-content {
    padding: 1.5rem;
    color: #6b7280;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .input-panel {
        order: 2;
    }
    
    .visualization-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .panel-header {
        padding: 1rem;
    }
    
    .input-form,
    .items-list {
        padding: 1rem;
    }
}