/* Main Styles for LearnWeaver */

/* Base styles */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #4b5563;
    background-color: #f9fafb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    border-top: 3px solid #8b5cf6;
    -webkit-animation: spin 1s cubic-bezier(0.42, 0, 0.58, 1) infinite;
    animation: spin 1s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

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

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

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

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

@-webkit-keyframes slideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

/* Card styles */
.card {
    transition: all 0.3s ease;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 1rem;
    overflow: hidden;
    -webkit-animation: fadeIn 0.5s ease;
    animation: fadeIn 0.5s ease;
    background-color: #fff;
}

.card:hover {
    transform: translateY(-4px);
    -webkit-transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Button styles */
.button-primary {
    background-color: #8b5cf6;
    color: white;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.button-primary:hover {
    background-color: #7c3aed;
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.button-primary:active {
    transform: translateY(1px);
    -webkit-transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

.button-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
    transition: all 0.2s ease;
    font-weight: 500;
}

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

.button-secondary:active {
    transform: translateY(1px);
    -webkit-transform: translateY(1px);
}

/* Form elements */
.input-field {
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    background-color: #fff;
}

.input-field:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

.select-field {
    transition: all 0.2s ease;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    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;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
}

.select-field:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    outline: none;
}

/* History tag styles */
.history-tag {
    transition: all 0.2s ease;
    background-color: #f3f4f6;
    color: #4b5563;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    cursor: pointer;
}

.history-tag:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
}

/* Title styles */
.title-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-image: linear-gradient(to right, #8b5cf6, #d946ef);
}

/* Template section styles */
.template-info {
    margin-top: 10px;
    font-style: italic;
    color: #6b7280;
    font-size: 14px;
}

/* Editor Tweaks */
.EasyMDEContainer {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-top: 1rem;
    display: block !important;
    width: 100% !important;
}

.editor-toolbar {
    border-color: #e5e7eb;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    background-color: #f9fafb;
    opacity: 1 !important;
}

.CodeMirror {
    height: 500px !important;
    border-color: #e5e7eb !important;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.CodeMirror-wrap {
    color: #374151 !important;
}

/* Ensure proper spacing between buttons */
.editor-toolbar > * {
    margin: 0 2px !important;
}

/* Proper spacing for separators */
.editor-toolbar i.separator {
    height: 20px !important;
    margin: 0 5px !important;
}

/* Status bar styling */
.editor-statusbar {
    padding: 8px 12px !important;
    color: #6B7280 !important;
    font-size: 12px !important;
    background-color: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Feature item styles */
.feature-item {
    transition: all 0.3s ease;
    padding: 1.5rem 1rem;
    text-align: center;
    -webkit-animation: fadeIn 0.6s ease;
    animation: fadeIn 0.6s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    -webkit-transform: translateY(-5px);
}

.feature-item:hover i {
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
}

.feature-item i {
    transition: all 0.3s ease;
}

.feature-disabled {
    transition: all 0.2s ease;
    cursor: not-allowed;
}

.feature-disabled:hover {
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
    box-shadow: 0 5px 10px -5px rgba(139, 92, 246, 0.15);
}

/* Settings page specific styles */
.template-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #f3f4f6;
}

.template-card:hover {
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
    box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.1);
}

.template-card:hover .template-actions {
    opacity: 1;
}

.template-actions {
    opacity: 0.7;
    transition: all 0.2s ease;
    display: flex;
    gap: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .CodeMirror {
        height: 300px !important;
    }
    
    .card {
        padding: 1rem !important;
    }
    
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }

    .feature-item {
        padding: 1.5rem !important;
    }
}

/* Hide the show preview button but keep the functionality intact */
#togglePreviewBtn {
    display: none !important;
} 