/* UX Improvements CSS for Laravel IPTV CMS */

/* Global Search Styles */
.global-search-overlay {
    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: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.global-search-modal {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
}

.search-input-container {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-icon {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 1rem;
    font-size: 1.2rem;
}

.global-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.1rem;
    color: #fff;
    padding: 0.5rem 0;
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.search-results-container {
    max-height: 500px;
    overflow-y: auto;
}

.search-results {
    padding: 1rem 0;
}

.search-summary {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-category {
    margin-bottom: 1.5rem;
}

.category-title {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.search-item:hover,
.search-item.active {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
}

.search-item .item-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary-color);
}

.search-item .item-content {
    flex: 1;
}

.search-item .item-title {
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.25rem;
}

.search-item .item-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
}

.search-item .item-description {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.search-item .item-meta {
    text-align: right;
}

.search-item .item-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.search-item .item-actions {
    display: flex;
    gap: 0.25rem;
}

.search-item .action-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.search-item .action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-item mark {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* Keyboard Shortcuts Styles */
.shortcuts-modal-overlay {
    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: 9999;
}

.shortcuts-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    color: #1f2937;
}

.dark-theme .shortcuts-modal {
    background: rgba(30, 41, 59, 0.95);
    color: #f8fafc;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
}

.modal-content {
    padding: 2rem;
    overflow-y: auto;
    max-height: 60vh;
}

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

.shortcuts-category h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.shortcut-item kbd {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--primary-color);
    min-width: 80px;
    text-align: center;
}

/* Contextual Help Styles */
.contextual-tooltip {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.tooltip-header h4 {
    margin: 0 0 0.5rem 0;
    color: #fff;
    font-size: 1rem;
}

.tooltip-body p {
    margin: 0 0 1rem 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.tooltip-tips {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-tips strong {
    color: #fff;
    font-size: 0.875rem;
}

.tooltip-tips ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.tooltip-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.tooltip-footer small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.help-trigger-btn {
    position: fixed;
    bottom: 20px;
    right: 80px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

/* Tour Styles */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.tour-highlight {
    animation: pulse-highlight 2s infinite;
}

.tour-tooltip {
    animation: slideInUp 0.3s ease;
}

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

.tour-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tour-progress {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tour-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

/* Keyboard Navigation Styles */
.keyboard-selected {
    background: rgba(99, 102, 241, 0.1) !important;
    border-left: 3px solid var(--primary-color) !important;
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.keyboard-selected td {
    background: transparent !important;
}

/* Shortcut Feedback */
.shortcut-feedback {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    z-index: 9999;
    animation: slideInDown 0.3s ease;
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.feedback-content kbd {
    background: rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Create Menu Styles */
.create-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.create-menu {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    min-width: 300px;
    color: #fff;
}

.create-menu h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.create-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.create-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease;
}

.create-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.create-option i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.create-option span {
    flex: 1;
    font-weight: 500;
}

.create-option kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Help Modal Styles */
.help-modal-overlay {
    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: 9999;
}

.help-modal {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-2xl);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    color: var(--text-primary);
}

.help-sections {
    display: grid;
    gap: 2rem;
}

.help-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.help-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.help-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.help-links a:hover {
    background: var(--glass-medium);
    transform: translateY(-2px);
}

.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.help-card {
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.help-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.help-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.help-card p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.help-card button {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-card button:hover {
    transform: scale(1.05);
}

/* Loading and Error States */
.search-loading,
.search-error,
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.search-loading .loading-spinner {
    margin-bottom: 1rem;
}

.search-error i,
.no-results i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Widget Edit Mode */
.widget-edit-mode .dashboard-widget {
    border: 2px dashed var(--primary-color);
    position: relative;
}

.widget-edit-mode .dashboard-widget::before {
    content: "Drag to reposition";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(99, 102, 241, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.widget-edit-mode .dashboard-widget:hover::before {
    opacity: 1;
}

/* Status Indicators */
.status-active { background: var(--success-light); color: var(--success); }
.status-inactive { background: var(--text-muted); color: white; }
.status-expired { background: var(--error-light); color: var(--error); }
.status-warning { background: var(--warning-light); color: var(--warning); }
.status-error { background: var(--error-light); color: var(--error); }

/* Mobile Optimizations */
@media (max-width: 768px) {
    .global-search-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .shortcuts-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .help-cards {
        grid-template-columns: 1fr;
    }
    
    .search-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .search-item .item-meta {
        align-self: stretch;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

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

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