/**
 * Enhanced Code Editor Styles
 * Programiz-inspired design with modern UI elements
 */

/* Notification System */
.notification {
    display: none;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    margin-bottom: 10px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #22C55E;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

.notification.notification-close {
    opacity: 0;
    transform: translateX(100%);
}

.notification.notification-error {
    border-left-color: #FF4444;
}

.notification-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.check-icon-wrapper {
    margin-right: 12px;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: #F3F4F6;
    color: #6B7280;
}

/* Progress Bar */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 3px 3px 0;
}

/* Enhanced Button Styles */
.enhanced-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.enhanced-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.enhanced-btn:active {
    transform: translateY(0);
}

.enhanced-btn.btn-secondary {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
}

.enhanced-btn.btn-secondary:hover {
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.enhanced-btn.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.enhanced-btn.btn-success:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.enhanced-btn.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.enhanced-btn.btn-danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(4px);
}

.share-modal.show {
    display: flex;
}

.share-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.share-modal.show .share-modal-content {
    transform: scale(1);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.share-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: #F3F4F6;
    color: #6B7280;
}

.share-url-container {
    margin-bottom: 20px;
}

.share-url-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #F9FAFB;
    color: #374151;
    margin-bottom: 12px;
}

.share-url-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.copy-url-btn {
    width: 100%;
    margin-bottom: 20px;
}

.social-share-section {
    border-top: 1px solid #E5E7EB;
    padding-top: 20px;
}

.social-share-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.social-share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.social-btn.twitter {
    background: #1DA1F2;
    color: white;
}

.social-btn.facebook {
    background: #1877F2;
    color: white;
}

.social-btn.linkedin {
    background: #0A66C2;
    color: white;
}

.social-btn.reddit {
    background: #FF4500;
    color: white;
}

.social-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

/* Code Editor Enhancements */
.editor-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: white;
}

.editor-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.editor-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Auto-save indicator */
.autosave-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.autosave-indicator.show {
    opacity: 1;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .notification {
        min-width: 280px;
        max-width: 90vw;
        margin: 0 10px;
    }
    
    .share-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .social-share-buttons {
        flex-direction: column;
    }
    
    .social-btn {
        justify-content: center;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .editor-actions {
        justify-content: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .notification {
        background: #1F2937;
        color: #F9FAFB;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .notification-message {
        color: #F9FAFB;
    }
    
    .share-modal-content {
        background: #1F2937;
        color: #F9FAFB;
    }
    
    .share-modal-title {
        color: #F9FAFB;
    }
    
    .share-url-input {
        background: #374151;
        border-color: #4B5563;
        color: #F9FAFB;
    }
    
    .editor-container {
        background: #1F2937;
    }
}