/**
 * Interactive Living Document Styles
 * Modern, engaging interface for dynamic learning
 */

.ild-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Header Section */
.ild-header {
    margin-bottom: 3rem;
}

.ild-greeting h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #6CFFC4;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.ild-greeting p {
    font-size: 1.125rem;
    color: #b0b0b0;
    animation: fadeInUp 0.6s ease-out 0.2s;
    animation-fill-mode: both;
}

/* Progress Bar */
.ild-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 2rem;
    overflow: hidden;
}

.ild-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6CFFC4 0%, #4ECDC4 100%);
    border-radius: 3px;
    transition: width 0.6s ease;
    box-shadow: 0 0 10px rgba(108, 255, 196, 0.5);
}

/* Deal Type Cards */
.ild-deal-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
}

.ild-deal-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.ild-deal-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #6CFFC4;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 255, 196, 0.2);
}

.ild-deal-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.ild-deal-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
}

.ild-deal-card p {
    font-size: 0.875rem;
    color: #b0b0b0;
    margin-bottom: 1.5rem;
}

.ild-card-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #6CFFC4 0%, #4ECDC4 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ild-card-btn:hover {
    background: linear-gradient(135deg, #7DFFD4 0%, #5EDDD4 100%);
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(108, 255, 196, 0.3);
}

/* Definition Tooltip */
.ild-definition-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    background: #2a2a2a;
    border: 1px solid rgba(108, 255, 196, 0.3);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
    margin-bottom: 0.5rem;
}

.ild-definition-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #2a2a2a;
}

/* Help Prompt */
.ild-help-prompt {
    background: rgba(108, 255, 196, 0.1);
    border: 1px solid rgba(108, 255, 196, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    animation: slideInUp 0.5s ease-out;
}

.ild-help-prompt p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: #e0e0e0;
}

.ild-help-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.ild-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.ild-btn-primary {
    background: linear-gradient(135deg, #6CFFC4 0%, #4ECDC4 100%);
    color: #1a1a1a;
}

.ild-btn-primary:hover {
    background: linear-gradient(135deg, #7DFFD4 0%, #5EDDD4 100%);
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(108, 255, 196, 0.3);
}

.ild-btn-secondary {
    background: transparent;
    color: #6CFFC4;
    border: 1px solid #6CFFC4;
}

.ild-btn-secondary:hover {
    background: rgba(108, 255, 196, 0.1);
    box-shadow: 0 5px 20px rgba(108, 255, 196, 0.2);
}

.ild-btn-ghost {
    background: transparent;
    color: #b0b0b0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ild-btn-ghost:hover {
    border-color: #6CFFC4;
    color: #6CFFC4;
}

/* Lesson Area */
.ild-lesson-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.ild-lesson-section h3 {
    font-size: 1.5rem;
    color: #6CFFC4;
    margin-bottom: 1rem;
}

/* Radio Options */
.ild-radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.ild-radio-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ild-radio-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #6CFFC4;
}

.ild-radio-option input[type="radio"] {
    display: none;
}

.ild-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #6CFFC4;
    border-radius: 50%;
    margin-right: 1rem;
    position: relative;
    flex-shrink: 0;
}

.ild-radio-option input[type="radio"]:checked ~ .ild-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #6CFFC4;
    border-radius: 50%;
    animation: scaleIn 0.2s ease;
}

.ild-radio-label {
    font-size: 1rem;
    color: #e0e0e0;
}

/* Interactive Elements */
.ild-poll {
    background: rgba(108, 255, 196, 0.05);
    border: 1px solid rgba(108, 255, 196, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.ild-poll h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #6CFFC4;
}

.ild-poll-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.ild-poll-option {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.ild-poll-option:hover {
    background: rgba(108, 255, 196, 0.1);
    border-color: #6CFFC4;
    transform: scale(1.05);
}

/* Mini Case */
.ild-mini-case {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.ild-case-scenario {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
}

.ild-case-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Exercise */
.ild-exercise {
    margin: 2rem 0;
}

.ild-exercise-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.ild-exercise-input:focus {
    outline: none;
    border-color: #6CFFC4;
    box-shadow: 0 0 0 2px rgba(108, 255, 196, 0.2);
}

/* Document Preview */
.ild-document-preview {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 3rem;
}

.ild-document-preview h3 {
    font-size: 1.25rem;
    color: #6CFFC4;
    margin-bottom: 1rem;
}

.ild-doc-placeholder {
    color: #666;
    font-style: italic;
}

.ild-doc-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ild-doc-section:last-child {
    border-bottom: none;
}

.ild-doc-metadata {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #888;
}

/* Interactive Toolbar */
.ild-interactive-toolbar {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
}

.ild-tool-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.ild-tool-btn:hover {
    background: rgba(108, 255, 196, 0.2);
    border-color: #6CFFC4;
    transform: scale(1.1);
}

.ild-tool-btn .ild-icon {
    font-size: 1.5rem;
}

/* Loading States */
.ild-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(108, 255, 196, 0.2);
    border-top-color: #6CFFC4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.ild-lesson-loading {
    text-align: center;
    padding: 3rem;
}

/* Notifications */
.ild-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.ild-notification.show {
    transform: translateX(0);
}

.ild-notification-success {
    border-left: 4px solid #6CFFC4;
}

.ild-notification-error {
    border-left: 4px solid #ff6b6b;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

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

/* Overlay */
.ild-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.ild-explanations-overlay {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideInUp 0.4s ease;
}

.ild-explanations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.ild-explanation-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
}

.ild-explanation-card h4 {
    font-size: 1.125rem;
    color: #6CFFC4;
    margin-bottom: 0.75rem;
}

.ild-explanation-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #b0b0b0;
}

/* Responsive */
@media (max-width: 768px) {
    .ild-wrapper {
        padding: 1rem;
    }
    
    .ild-deal-types {
        grid-template-columns: 1fr;
    }
    
    .ild-case-actions {
        flex-direction: column;
    }
    
    .ild-interactive-toolbar {
        right: 1rem;
        bottom: 1rem;
    }
    
    .ild-tool-btn {
        width: 40px;
        height: 40px;
    }
    
    .ild-tool-btn .ild-icon {
        font-size: 1.25rem;
    }
}

/* Dark scrollbar */
.ild-wrapper ::-webkit-scrollbar {
    width: 8px;
}

.ild-wrapper ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.ild-wrapper ::-webkit-scrollbar-thumb {
    background: rgba(108, 255, 196, 0.3);
    border-radius: 4px;
}

.ild-wrapper ::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 255, 196, 0.5);
}