/**
 * Unified Interface Enhancements
 * Additional styles for improved functionality
 */

/* Fix for button overlap issues */
.tutor-card {
    position: relative;
}

.tutor-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40 !important;
    width: 85%;
    max-width: 280px;
    pointer-events: auto;
}

.card-inner {
    pointer-events: none;
}

.card-inner .info-icon,
.card-inner .online-indicator {
    pointer-events: auto;
}

/* Action button improvements */
.action-button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #6CFFC4 0%, #4bb89d 100%);
    border: none;
    border-radius: 8px;
    color: #0D353E;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 15px rgba(108, 255, 196, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 255, 196, 0.4);
    background: linear-gradient(135deg, #7FFFD4 0%, #5cc9ad 100%);
}

.action-button span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Calendar button in chat */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-calendar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.chat-calendar-btn:hover {
    background: rgba(108, 255, 196, 0.2);
    border-color: #6CFFC4;
    color: #6CFFC4;
}

/* Try AI button fix */
.try-ai-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #6CFFC4 0%, #4bb89d 100%);
    color: #0D353E;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(108, 255, 196, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
    z-index: 25;
}

.try-ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 255, 196, 0.4);
}

/* Resource footer fix */
.resource-footer {
    background: rgba(16, 43, 48, 0.8);
    padding: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(108, 255, 196, 0.2);
}

.resource-footer p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
}

/* Welcome resources improvements */
.welcome-resources {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.welcome-resource-btn {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(108, 255, 196, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.welcome-resource-btn:hover {
    background: rgba(108, 255, 196, 0.1);
    border-color: #6CFFC4;
    transform: translateY(-2px);
}

.resource-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}

.resource-desc {
    font-size: 0.8rem;
    color: #6CFFC4;
    margin-top: 0.25rem;
}

/* Search functionality */
.unified-search {
    position: relative;
    max-width: 600px;
    margin: 2rem auto;
}

.unified-search input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(108, 255, 196, 0.3);
    border-radius: 25px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.unified-search input:focus {
    outline: none;
    border-color: #6CFFC4;
    background: rgba(255, 255, 255, 0.08);
}

.unified-search button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #6CFFC4;
    color: #0D353E;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.unified-search button:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Personalized greetings */
.personalized-greeting {
    background: linear-gradient(135deg, rgba(108, 255, 196, 0.1) 0%, rgba(75, 184, 157, 0.1) 100%);
    border: 1px solid rgba(108, 255, 196, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.greeting-time {
    font-size: 0.9rem;
    color: #6CFFC4;
    margin-bottom: 0.5rem;
}

.greeting-message {
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.5;
}

/* Lazy loading placeholders */
.lazy-loading {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.lazy-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: lazy-shimmer 1.5s infinite;
}

@keyframes lazy-shimmer {
    to {
        left: 100%;
    }
}

/* Performance optimizations */
.tutor-card img {
    will-change: transform;
}

.tutor-card:hover img {
    transform: scale(1.05);
}

/* Ensure proper stacking */
.sfpe-unified-interface {
    position: relative;
    z-index: 1;
}

.mesh-gradient {
    position: absolute;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 2;
}

/* Search highlights */
.tutor-card.search-highlight {
    border-color: #6CFFC4;
    box-shadow: 0 0 0 3px rgba(108, 255, 196, 0.3);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 3px rgba(108, 255, 196, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(108, 255, 196, 0.1);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(108, 255, 196, 0.3);
    }
}

.no-search-results {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem auto;
    max-width: 400px;
    text-align: center;
}

.no-search-results p {
    color: #ff9999;
    margin-bottom: 0.5rem;
}

.clear-search {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-search:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
    .action-button {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .welcome-resources {
        flex-direction: column;
    }
    
    .welcome-resource-btn {
        min-width: auto;
    }
    
    .try-ai-button {
        bottom: 1rem;
        right: 1rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}