/**
 * Chatbot Styles - HomilyWriterAI
 * Beautiful, modern UI for AI chatbot
 * Version: 1.0.17
 */

/* Remove padding from dashboard-content for chatbot page */
.dashboard-content {
    padding: 0 !important;
}

/* Container */
.chatbot-container {
    background: white;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    position: relative;
}

/* Chat Header */
.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: linear-gradient(135deg, #6490d3 0%, #4e81bc 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.chat-header-left h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
}

.chat-header-left h1 i {
    margin-right: 0.5rem;
}

.chat-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Model Selector */
.model-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-selector label {
    font-weight: 500;
    white-space: nowrap;
}

.model-select {
    padding: 0.6rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-select:hover {
    background: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.model-select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Action Buttons */
.btn-icon {
    padding: 0.6rem 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-icon i {
    font-size: 0.9rem;
}

/* Welcome Screen */
.welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem;
    padding-top: 0.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    overflow-y: auto;
}

.welcome-content {
    text-align: center;
    max-width: 700px;
}

.welcome-icon {
    font-size: 2.5rem;
    color: #6490d3;
    margin-bottom: 0.5rem;
}

.welcome-content h2 {
    font-size: 1.4rem;
    color: #2a6b9d;
    margin-bottom: 0.5rem;
}

.welcome-content > p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.model-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feature-card:active {
    transform: scale(0.95);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1.2rem;
    color: white;
}

.claude-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.chatgpt-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gemini-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.grok-icon {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.feature-card h3 {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 0.3rem;
}

.feature-card p {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
}

/* Chat Messages */
.chat-messages {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: #fafafa;
    display: none;
}

.chat-messages:not(:empty) {
    display: block;
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: messageSlideIn 0.3s ease;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #6490d3 0%, #4e81bc 100%);
}

.assistant-message .message-avatar.claude-avatar {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.assistant-message .message-avatar.chatgpt-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.assistant-message .message-avatar.gemini-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.assistant-message .message-avatar.grok-avatar {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.message-content {
    flex: 1;
    max-width: calc(100% - 56px);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.message-name {
    font-weight: 600;
    color: #333;
}

.model-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.claude-badge {
    background: #8b5cf6;
    color: white;
}

.chatgpt-badge {
    background: #10b981;
    color: white;
}

.gemini-badge {
    background: #3b82f6;
    color: white;
}

.grok-badge {
    background: #f97316;
    color: white;
}

.message-text {
    background: white;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    line-height: 1.6;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.user-message .message-text {
    background: linear-gradient(135deg, #6490d3 0%, #4e81bc 100%);
    color: white;
}

/* Typing Cursor */
.typing-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    margin-left: 2px;
    font-weight: bold;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Error Text */
.error-text {
    color: #dc3545;
    font-style: italic;
}

/* Chat Input */
.chat-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 2rem 1.5rem;
    border-top: 2px solid #f0f0f0;
    background: white;
    border-radius: 0 0 12px 12px;
    z-index: 10;
}

.chat-input-main {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    gap: 1rem;
}

/* Backward compatibility */
.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 1rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 50px;
    max-height: 150px;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #6490d3;
    box-shadow: 0 0 0 3px rgba(100, 144, 211, 0.1);
}

.chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.send-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6490d3 0%, #4e81bc 100%);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4e81bc 0%, #2a6b9d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 144, 211, 0.3);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-input-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Past Chats Sidebar */
.past-chats-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.past-chats-sidebar.active {
    right: 0;
}

.sidebar-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #6490d3 0%, #4e81bc 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: white;
}

.close-sidebar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 1.1rem;
}

.close-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.past-chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.past-chat-item {
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.past-chat-item:hover {
    background: #f0f0f0;
    transform: translateX(-3px);
}

.past-chat-info {
    flex: 1;
    min-width: 0;
}

.past-chat-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.past-chat-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.past-chat-time {
    font-size: 0.8rem;
    color: #999;
}

.delete-chat-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #dc3545;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.delete-chat-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #999;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Error Notification */
.error-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile sidebar toggle */
    .dashboard-sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    #mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .dashboard-sidebar.active ~ #mobile-sidebar-overlay,
    body:has(.dashboard-sidebar.active) #mobile-sidebar-overlay {
        display: block;
    }

    /* Adjust dashboard main to take full width on mobile */
    .dashboard-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Mobile header fixes */
    .dashboard-header {
        height: auto;
        min-height: 60px;
        padding: 0.75rem 1rem;
    }

    /* Hide logo and Chat title on mobile */
    .dashboard-header .header-logo,
    .dashboard-header .header-title h2 {
        display: none !important;
    }

    .dashboard-header .header-title {
        width: auto;
        flex: 0;
        min-width: 0;
    }

    .chatbot-header-actions {
        gap: 0.5rem;
        flex: 1;
        justify-content: flex-end;
    }

    /* Hide New Chat button on mobile */
    #new-chat-btn {
        display: none !important;
    }

    /* Show mobile new chat button only on mobile */
    .mobile-new-chat-btn {
        display: inline-flex !important;
    }

    /* Hide notification and support buttons on mobile */
    #notifications-bell,
    #support-chat-btn {
        display: none !important;
    }

    .chatbot-model-selector {
        flex: 1;
        min-width: 0;
        max-width: 200px;
    }

    .chatbot-model-selector label {
        font-size: 0.85rem;
    }

    .chatbot-model-select {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
        width: 100%;
        min-width: 0;
    }

    .chatbot-action-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .chatbot-action-btn i {
        font-size: 0.85rem;
    }

    /* Container adjustments - fixed positioning */
    .dashboard-content {
        padding: 0 !important;
        height: calc(100vh - 60px);
    }

    .chatbot-container {
        height: 100%;
        max-height: 100%;
    }

    /* Welcome screen on mobile - MUCH more compact */
    .welcome-screen {
        bottom: 130px;
        padding: 0.5rem;
        padding-top: 0.25rem;
    }

    .welcome-icon {
        font-size: 1.8rem !important;
        margin-bottom: 0.3rem !important;
    }

    .welcome-content h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.3rem !important;
    }

    .welcome-content > p {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }

    .model-features {
        margin-top: 0.5rem !important;
        gap: 0.5rem !important;
    }

    .feature-card {
        padding: 0.5rem !important;
    }

    .feature-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 1rem !important;
        margin-bottom: 0.3rem !important;
    }

    .feature-card h3 {
        font-size: 0.8rem !important;
        margin-bottom: 0.2rem !important;
    }

    .feature-card p {
        font-size: 0.7rem !important;
        line-height: 1.2 !important;
    }

    /* Chat messages on mobile */
    .chat-messages {
        bottom: 130px;
        padding: 1rem;
    }

    /* Ensure input stays fixed at bottom on mobile */
    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        z-index: 100;
        background: white;
        display: flex;
        flex-direction: column;
    }

    /* Plus button row appears first (above input) on mobile */
    .chat-input-footer {
        order: -1;
        margin-top: 0;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Input and send button row appears second on mobile */
    .chat-input-main {
        order: 1;
        display: flex;
        gap: 1rem;
        align-items: flex-end;
    }

    /* Hide hint text on mobile */
    .chat-input-hint {
        display: none;
    }

    .past-chats-sidebar {
        width: 100%;
        right: -100%;
    }

    /* Welcome screen mobile optimizations */
    .welcome-screen {
        padding: 1rem;
    }

    .welcome-content {
        max-width: 100%;
    }

    .welcome-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .welcome-content h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .welcome-content > p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        line-height: 1.4;
    }

    /* Model features in 2 columns on mobile */
    .model-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .feature-card h3 {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .feature-card p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    /* Very small screens */
    .chatbot-model-selector label {
        display: none;
    }

    .chatbot-model-select {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .chatbot-action-btn span {
        display: none;
    }

    .chatbot-action-btn {
        padding: 0.5rem;
    }

    .chatbot-model-selector {
        max-width: 150px;
    }
}

/* Chatbot Header Styles */
.dashboard-header .header-title {
    justify-content: flex-start;
    width: auto;
}

/* Hide mobile new chat button on desktop */
.mobile-new-chat-btn {
    display: none;
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chatbot-model-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-model-selector label {
    white-space: nowrap;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.chatbot-model-select {
    padding: 0.6rem 1rem;
    border: 2px solid rgba(100, 144, 211, 0.3);
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-model-select:hover {
    border-color: #6490d3;
}

.chatbot-model-select:focus {
    outline: none;
    border-color: #6490d3;
    box-shadow: 0 0 0 3px rgba(100, 144, 211, 0.1);
}

.chatbot-action-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid rgba(100, 144, 211, 0.3);
    border-radius: 6px;
    background: linear-gradient(135deg, #6490d3 0%, #4e81bc 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-action-btn:hover {
    background: linear-gradient(135deg, #4e81bc 0%, #2a6b9d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 144, 211, 0.3);
}

.chatbot-action-btn i {
    font-size: 0.9rem;
}

/* Chat Features Link */
.chat-features-link {
    margin-top: 1.5rem;
    text-align: center;
}

.chat-features-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6490d3;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 2px solid #6490d3;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
}

.chat-features-link a:hover {
    background: linear-gradient(135deg, #6490d3 0%, #4e81bc 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 144, 211, 0.3);
}

.chat-features-link a i {
    font-size: 1rem;
}

/* Mobile styles for chat features link */
@media (max-width: 768px) {
    .chat-features-link {
        margin-top: 1rem;
    }

    .chat-features-link a {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .chat-features-link {
        margin-top: 0.75rem;
    }

    .chat-features-link a {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}

/* Attach Button (Plus Icon) */
.attach-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: white;
    color: #6490d3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.attach-btn:hover {
    background: #6490d3;
    color: white;
    border-color: #6490d3;
    transform: rotate(90deg);
}

.attach-btn i {
    font-size: 1.1rem;
}

/* Attach Options Menu */
.attach-menu {
    position: absolute;
    bottom: 70px;
    left: 2rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 20;
}

.attach-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.attach-option {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.2s ease;
}

.attach-option:hover {
    background: #f5f8ff;
    color: #6490d3;
}

.attach-option i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Homily Selector Modal */
.homily-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.homily-selector-modal.active {
    display: flex;
}

.homily-selector-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

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

.homily-selector-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.homily-selector-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2a6b9d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-homily-selector {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-homily-selector:hover {
    background: #f0f0f0;
    color: #333;
}

.homily-selector-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.homily-search-box {
    margin: 1.5rem 1.5rem 1rem;
    position: relative;
}

.homily-search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.homily-search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.homily-search-box input:focus {
    outline: none;
    border-color: #6490d3;
}

.homily-selector-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 1.5rem;
}

.homily-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #999;
}

.homily-loader i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.homily-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.homily-item:hover {
    border-color: #6490d3;
    box-shadow: 0 2px 8px rgba(100, 144, 211, 0.15);
    transform: translateY(-2px);
}

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

.homily-item-title {
    font-weight: 600;
    color: #2a6b9d;
    font-size: 1rem;
}

.homily-item-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #e8f4f8;
    color: #2a6b9d;
}

.homily-item-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.homily-item-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.homily-item-meta-item i {
    font-size: 0.8rem;
}

.homily-item-preview {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.homily-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.homily-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.homily-empty-state h4 {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .attach-menu {
        left: 1rem;
        bottom: 60px;
    }

    .homily-selector-content {
        max-height: 90vh;
    }

    .homily-selector-header {
        padding: 1rem;
    }

    .homily-search-box {
        margin: 1rem 1rem 0.75rem;
    }

    .homily-selector-list {
        padding: 0 1rem 1rem;
    }

    .homily-item {
        padding: 0.75rem;
    }
}
