/* ============================================
   MEGA ENHANCEMENT PACKAGE - PHASE 1 STYLES
   ============================================ */

/* ============================================
   1. LOADING SKELETONS
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-text {
    height: 12px;
    border-radius: 6px;
}

/* ============================================
   2. TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    backdrop-filter: blur(10px);
    min-width: 200px;
    max-width: 400px;
}

.toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
}

.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
}

.toast.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
}

.toast.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
}

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

.toast.hiding {
    animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideDown {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@media (max-width: 768px) {
    #toast-container {
        bottom: 100px;
        left: 20px;
        right: 20px;
        transform: none;
    }
    
    .toast {
        width: 100%;
        max-width: none;
    }
}

/* ============================================
   3. SERVICE RATINGS
   ============================================ */

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 32px;
}

.rating-star {
    color: #fbbf24;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-star:hover {
    transform: scale(1.2);
}

.service-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #fbbf24;
}

/* ============================================
   4. SEARCH AUTOCOMPLETE
   ============================================ */

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.autocomplete-item {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

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

.autocomplete-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: var(--bg-body);
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ============================================
   5. LAZY LOADING
   ============================================ */

img[data-src] {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

img[data-src].loaded {
    filter: blur(0);
}

/* ============================================
   6. ENHANCED RECENTLY USED SECTION
   ============================================ */

.recently-used-section {
    margin: 20px;
    padding: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
}

.recently-used-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.recently-used-section .section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.recently-used-section .section-header h3 i {
    color: #3b82f6;
    font-size: 18px;
}

.clear-recent-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-recent-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.05);
}

.recently-used-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.recently-used-scroll::-webkit-scrollbar {
    height: 6px;
}

.recently-used-scroll::-webkit-scrollbar-track {
    background: var(--bg-body);
    border-radius: 10px;
}

.recently-used-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.recently-used-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-sub);
}

.recent-card {
    min-width: 120px;
    max-width: 120px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.recent-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-color: #3b82f6;
}

.recent-card .icon-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 10px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-card:hover .icon-tile {
    transform: scale(1.15) rotate(5deg);
}

.recent-card-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recent-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #3b82f6;
    color: white;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* ============================================
   7. KEYBOARD SHORTCUTS HELP
   ============================================ */

.keyboard-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.shortcut-description {
    font-size: 13px;
    color: var(--text-main);
}

/* ============================================
   8. SERVICE PREVIEW MODAL
   ============================================ */

.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.preview-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.preview-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.preview-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.preview-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.preview-image {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.preview-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .recently-used-section {
        margin: 15px;
        padding: 15px;
    }
    
    .recent-card {
        min-width: 100px;
        max-width: 100px;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-content {
        padding: 20px;
        max-height: 90vh;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

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

/* Apply animations */
.recently-used-section {
    animation: slideInUp 0.5s ease;
}

.toast {
    animation: slideInUp 0.3s ease;
}

.preview-modal {
    animation: fadeIn 0.3s ease;
}

.preview-content {
    animation: scaleIn 0.3s ease;
}


/* ============================================
   PHASE 2: PROGRESS INDICATORS
   ============================================ */

/* Progress Bar Animations */
@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.progress-bar-fill {
    animation: progressPulse 1.5s ease-in-out infinite;
}

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

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

/* File Upload Item */
.file-upload-item {
    transition: all 0.3s ease;
}

.file-upload-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cancel-upload-btn:hover {
    background: #ef4444 !important;
    color: white !important;
    transform: scale(1.05);
}

/* Circular Progress */
.circular-progress {
    display: inline-block;
}

/* Processing Modal */
.processing-modal {
    animation: fadeIn 0.3s ease;
}

.processing-content {
    animation: scaleIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .processing-content {
        padding: 30px 20px !important;
    }
    
    .file-upload-item {
        padding: 12px !important;
    }
}


/* ============================================
   DASHBOARD PERSONALIZATION STYLES
   ============================================ */

/* View Toggle Button */
#view-toggle,
#settings-btn {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: var(--shadow-card);
}

#view-toggle:hover,
#settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #3b82f6;
}

/* Grid View (Default) */
#menu-grid.grid-view {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 40px !important;
}

/* List View */
#menu-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#menu-grid.list-view .menu-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 15px 20px;
    max-width: 100%;
}

#menu-grid.list-view .menu-card .menu-icon {
    font-size: 24px;
    margin-right: 15px;
    margin-bottom: 0;
}

#menu-grid.list-view .menu-card .menu-title {
    font-size: 16px;
    text-align: left;
}

#menu-grid.list-view .menu-card .menu-desc {
    display: block;
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
}

/* Drag and Drop States */
.menu-card[draggable="true"] {
    cursor: move;
    user-select: none;
}

.menu-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    cursor: grabbing;
}

.menu-card.drag-over {
    border: 2px dashed #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

/* Hidden Service Indicator */
.menu-card.hidden-service {
    display: none !important;
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.settings-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

/* Settings Header */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}

.settings-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header .close-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.settings-header .close-btn:hover {
    background: var(--bg-body);
    color: var(--text-main);
}

/* Settings Body */
.settings-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.setting-description {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: var(--text-sub);
}

/* Setting Item */
.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.setting-item label:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.setting-item input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.setting-item label span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-main);
}

/* Service List */
.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-body);
    border-radius: 10px;
}

.service-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.service-item:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.service-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.service-item span {
    font-size: 13px;
    color: var(--text-main);
}

/* Reset Button */
.btn-reset {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-reset:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Settings Footer */
.settings-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.settings-footer .btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.settings-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .settings-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .service-list {
        grid-template-columns: 1fr;
    }
    
    #menu-grid.list-view .menu-card {
        padding: 12px 15px;
    }
}

/* Smooth Transitions */
.menu-card {
    transition: transform 0.2s ease, opacity 0.2s ease, border 0.2s ease;
}

/* Icon Button Base Style */
.icon-btn {
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: var(--shadow-card);
    font-size: 16px;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #3b82f6;
}
