/* Enhanced UI Components CSS */

/* ============================================
   Search Modal
   ============================================ */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal.active {
    display: flex;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease-out;
}

.search-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    padding: 0.75rem 0;
    font-size: 1.125rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

#search-input::placeholder {
    color: var(--text-tertiary);
}

.search-close {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.search-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
}

.search-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-empty p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.search-empty-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.search-suggestions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.search-suggestions span {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.suggestion-chip {
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateX(4px);
}

.search-result-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.search-result-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

.search-result-badge {
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.difficulty-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid;
}

.companies-badge {
    color: var(--text-tertiary);
}

.progress-badge {
    padding: 0.25rem 0.5rem;
    background: var(--success-light);
    color: var(--success);
    border-radius: 4px;
    font-weight: 500;
}

.search-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 16px 16px;
}

.search-shortcuts {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.search-shortcuts kbd {
    padding: 0.25rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    box-shadow: 0 2px 0 var(--border-color);
}

/* ============================================
   Progress Dashboard
   ============================================ */
.progress-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.progress-dashboard.active {
    display: flex;
}

.progress-dashboard-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.progress-dashboard-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.progress-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.progress-dashboard-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.progress-close {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.progress-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.progress-dashboard-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.progress-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
}

.progress-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.progress-empty h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-stat-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
}

.progress-stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.progress-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-item {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.progress-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.progress-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.progress-item-title {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.progress-item-percentage {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-item-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-item-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: 50px;
    transition: width 0.6s ease-out;
}

.progress-item-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.progress-dashboard-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 16px 16px;
}

.btn-danger {
    padding: 0.75rem 1.5rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-2px);
}

/* ============================================
   Share Buttons
   ============================================ */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-twitter {
    color: #1DA1F2;
}

.share-twitter:hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
    color: white;
}

.share-linkedin {
    color: #0A66C2;
}

.share-linkedin:hover {
    background: #0A66C2;
    border-color: #0A66C2;
    color: white;
}

.share-copy {
    color: var(--text-secondary);
}

.share-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ============================================
   Toast Notification
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 1rem 1.5rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    font-weight: 500;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease-out;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================
   Floating Action Buttons
   ============================================ */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   Company Tags
   ============================================ */
.company-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.company-tag {
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.company-tag:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

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

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

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .search-modal {
        padding-top: 5vh;
    }
    
    .search-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .search-header {
        padding: 1rem;
    }
    
    #search-input {
        font-size: 1rem;
    }
    
    .search-filters {
        gap: 0.375rem;
    }
    
    .filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .progress-dashboard-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .progress-dashboard-header {
        padding: 1rem 1.5rem;
    }
    
    .progress-dashboard-header h2 {
        font-size: 1.25rem;
    }
    
    .progress-dashboard-body {
        padding: 1.5rem 1rem;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
    }
    
    .progress-dashboard-footer {
        flex-direction: column;
        padding: 1rem;
    }
    
    .progress-dashboard-footer button {
        width: 100%;
    }
    
    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .fab {
        width: 48px;
        height: 48px;
    }
}

/* Scrollbar Styling */
.search-results::-webkit-scrollbar,
.progress-dashboard-body::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track,
.progress-dashboard-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.search-results::-webkit-scrollbar-thumb,
.progress-dashboard-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover,
.progress-dashboard-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}
