.ai-icon-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ai-recipe-button {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.ai-recipe-button:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.ai-icon-wrapper {
    display: flex;
    align-items: center;
    line-height: 1;
}

.ai-icon-clickable {
    height: 18px;
    width: auto;
    display: block;
    filter: brightness(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.ai-button-text {
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    user-select: none;
}

.ai-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-modal-content .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-modal-content .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-modal-content .recipe-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #333 !important;
}

.ai-modal-content .recipe-card * {
    color: inherit !important;
}

.ai-modal-content .recipe-card:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#imageGenerationModal.ai-modal-content .modal-body,
#imageGenerationModal .ai-modal-content .modal-body {
    color: white;
}

#imageGenerationModal.ai-modal-content .modal-body h5,
#imageGenerationModal.ai-modal-content .modal-body h6,
#imageGenerationModal.ai-modal-content .modal-body p,
#imageGenerationModal.ai-modal-content .modal-body .text-muted,
#imageGenerationModal .ai-modal-content .modal-body h5,
#imageGenerationModal .ai-modal-content .modal-body h6,
#imageGenerationModal .ai-modal-content .modal-body p,
#imageGenerationModal .ai-modal-content .modal-body .text-muted {
    color: white !important;
}

#imageGenerationModal.ai-modal-content .modal-body .small,
#imageGenerationModal .ai-modal-content .modal-body .small {
    color: rgba(255, 255, 255, 0.9) !important;
}

.ai-modal-content .recipe-summary {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
}

.ai-modal-content .btn-outline-primary {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.ai-modal-content .btn-outline-primary:hover {
    color: #667eea;
    background: white;
    border-color: white;
}

.ai-modal-content .btn-info {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.ai-modal-content .btn-info:hover {
    color: #667eea;
    background: white;
    border-color: white;
}

.ai-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ai-animated-text {
    width: 100%;
    max-width: 400px;
    height: 50px;
    margin: auto;
    overflow: hidden;
    position: relative;
}

.loading-dots {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-weight: 500;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    overflow: hidden;
}

.loading-dots.typing {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
}

.loading-dots.typing::after {
    content: '|';
    animation: blink 1s infinite;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 2px;
}

.loading-dots.pulse-text {
    animation: pulse-glow-text 0.8s ease-in-out;
}

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

@keyframes pulse-glow-text {
    0% { 
        transform: translateY(-50%) scale(1);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    50% { 
        transform: translateY(-50%) scale(1.02);
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    100% { 
        transform: translateY(-50%) scale(1);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

.loading-dots::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: loading-indicator 2s infinite;
}

@keyframes loading-indicator {
    0%, 20% { 
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    40%, 60% { 
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    80%, 100% { 
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
}

.ai-video-container {
    position: relative;
    width: 300px !important;
    height: 300px !important;
    margin: 0 auto 20px auto;
    border-radius: 50% !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.ai-food-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        transparent 25%, 
        transparent 75%, 
        rgba(118, 75, 162, 0.05) 100%);
    pointer-events: none;
    border-radius: 50%;
}

.ai-progress-container {
    width: 100%;
}

.ai-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 300% 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: gradient-flow 2s ease-in-out infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#ai-loading-phrase {
    font-size: 16px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.2s ease;
    animation: text-float 3s ease-in-out infinite;
}

@keyframes text-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.ai-loader-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-loader-backdrop.show {
    opacity: 1;
}

.ai-loader-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    min-width: 350px;
    max-width: 90vw;
    position: relative;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ai-loader-backdrop.show .ai-loader-container {
    transform: scale(1);
}

.ai-loader-container::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: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ai-loader-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    gap: 12px;
}

.ai-star-icon-large {
    width: 32px;
    height: 32px;
    color: #ffd700;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
    animation: rotate-pulse 3s ease-in-out infinite;
}

@keyframes rotate-pulse {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(270deg) scale(1.1);
    }
}

.ai-loader-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ai-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 300% 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: gradient-flow 2s ease-in-out infinite;
    position: relative;
}

.ai-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.ai-loading-text {
    margin-bottom: 25px;
}

#ai-loading-phrase {
    font-size: 16px;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.2s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: text-float 3s ease-in-out infinite;
}

@keyframes text-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.ai-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.ai-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* Native Dialog Styles */
.ai-recipe-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 90vw;
    background: transparent;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-recipe-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.ai-recipe-dialog .ai-dialog-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    width: 100%;
    min-width: 400px;
    color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-recipe-dialog .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 8px;
}

.ai-recipe-dialog .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
    color: white;
}

.ai-recipe-dialog .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ai-image-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-image-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.ai-dialog-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    width: 100%;
    min-width: 800px;
    color: white;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.ai-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ai-dialog-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.ai-dialog-row {
    display: flex;
    gap: 24px;
    height: 100%;
}

.ai-dialog-col-main {
    flex: 2;
    min-width: 0;
}

.ai-dialog-col-sidebar {
    flex: 1;
    min-width: 300px;
}

.ai-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-dialog-body h5,
.ai-dialog-body h6,
.ai-dialog-body p,
.ai-dialog-body .text-muted,
.ai-dialog-body .small {
    color: white !important;
}

.ai-dialog-body .small {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Form controls in dialog */
.ai-image-dialog .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 8px;
}

.ai-image-dialog .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
    color: white;
}

.ai-image-dialog .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Loading spinner in dialog */
.ai-image-dialog .spinner-border {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

@media (max-width: 768px) {
    .ai-icon-container {
        justify-content: center;
    }
    
    .ai-recipe-button {
        flex-direction: column;
        gap: 4px;
    }
    
    .ai-button-text {
        font-size: 12px;
        line-height: 14px;
    }
    
    .ai-icon-clickable {
        height: 16px;
    }
    
    .ai-loader-container {
        padding: 20px;
        min-width: 280px;
    }
    
    .ai-loader-header h3 {
        font-size: 18px;
    }
    
    .ai-video-container {
        width: 250px !important;
        height: 250px !important;
    }
    
    .ai-animated-text {
        max-width: 95vw;
        height: 45px;
    }
    
    .ai-dialog-content {
        min-width: 95vw;
        max-height: 95vh;
    }
    
    .ai-dialog-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .ai-dialog-col-sidebar {
        min-width: auto;
    }
    
    .ai-recipe-dialog {
        max-width: 95vw;
        width: 95vw;
    }
    
    .ai-recipe-dialog .ai-dialog-content {
        min-width: auto;
    }
}