/**
 * Optic Cabo - Index Page Additional Styles
 * index-styles.css
 * Blog cards, modals, AI chat widget, carousel, and dynamic content styles
 */

/* ==================== BANNER CAROUSEL ==================== */
.banner {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 500px;
    max-height: 800px;
    overflow: hidden;
}

.carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(26, 26, 46, 0.3) 0%,
        rgba(26, 26, 46, 0.5) 50%,
        rgba(26, 26, 46, 0.7) 100%
    );
}

/* Navigation Arrows */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.8);
    border: none;
    border-radius: 50%;
    color: #1a1a2e;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: #D4AF37;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.5);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

/* Dots Navigation */
.carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.dot.active {
    background: #D4AF37;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Banner Content Overlay */
.banner .content-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
    color: white;
    padding: 20px;
}

.banner .content-banner p {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #D4AF37;
    margin-bottom: 15px;
    animation: fadeInUp 1s ease;
}

.banner .content-banner h2 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease 0.3s both;
}

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

/* Responsive Carousel */
@media (max-width: 768px) {
    .banner {
        height: 60vh;
        min-height: 400px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .carousel-btn.prev {
        left: 10px;
    }

    .carousel-btn.next {
        right: 10px;
    }

    .carousel-dots {
        bottom: 20px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    .banner .content-banner h2 {
        font-size: 1.8rem;
    }

    .banner .content-banner p {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .banner {
        height: 50vh;
        min-height: 350px;
    }

    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .banner .content-banner h2 {
        font-size: 1.5rem;
    }
}

/* ==================== AI CHAT WIDGET ==================== */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Chat Toggle Button */
.chat-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    border-radius: 50%;
    color: #1a1a2e;
    font-size: 1.8rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 25px rgba(212, 175, 55, 0.5);
    transition: all 0.3s ease;
    animation: pulse-chat 2s infinite;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 35px rgba(212, 175, 55, 0.7);
}

.chat-toggle-btn.hidden {
    display: none;
}

@keyframes pulse-chat {
    0%, 100% { box-shadow: 0 4px 25px rgba(212, 175, 55, 0.5); }
    50% { box-shadow: 0 4px 35px rgba(212, 175, 55, 0.8); }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.active {
    display: flex;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #1a1a2e;
}

.chat-header-info {
    flex: 1;
}

.chat-header-info h4 {
    color: #D4AF37;
    margin: 0;
    font-size: 1rem;
}

.chat-header-info span {
    color: #10b981;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-header-info span::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

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

.chat-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-message.user {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #1a1a2e;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chat-message.typing {
    background: white;
    padding: 15px 20px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #D4AF37;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Actions */
.chat-quick-actions {
    padding: 10px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 8px 14px;
    background: #f0f2f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #1a1a2e;
    border-color: #D4AF37;
}

/* Chat Input */
.chat-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #D4AF37;
}

.chat-input::placeholder {
    color: #999;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    border: none;
    border-radius: 50%;
    color: #1a1a2e;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* WhatsApp Link in Chat */
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 8px;
    transition: all 0.3s;
}

.whatsapp-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 75px;
        right: 0;
        border-radius: 15px;
    }
    
    .chat-toggle-btn {
        width: 58px;
        height: 58px;
        font-size: 1.6rem;
    }
}

/* ==================== BLOG CARD IMPROVEMENTS ==================== */
.card-blog .content-blog p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
    max-height: 6.4em;
    transition: all 0.4s ease;
}

.card-blog .content-blog p.expanded {
    -webkit-line-clamp: unset;
    max-height: 2000px;
    overflow: visible;
}

/* ==================== READ MORE BUTTON ==================== */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.btn-read-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

.btn-read-more i {
    transition: transform 0.3s ease;
}

.btn-read-more.active i {
    transform: rotate(180deg);
}

/* ==================== BLOG MODAL (Mobile) ==================== */
.blog-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

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

.blog-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

/* Modal Header */
.blog-modal-header {
    position: relative;
}

.blog-modal-header img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

/* Modal Close Button */
.blog-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.blog-modal-close:hover {
    background: #D4AF37;
    color: white;
    transform: rotate(90deg);
}

/* Modal Body */
.blog-modal-body {
    padding: 30px;
}

.blog-modal-body h2 {
    color: #1a1a2e;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.blog-modal-body .blog-date {
    color: #D4AF37;
    font-weight: 600;
    margin-bottom: 20px;
    display: block;
}

.blog-modal-body .blog-text {
    color: #555;
    line-height: 1.8;
    font-size: 1rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .blog-modal-header img {
        height: 200px;
    }
    
    .blog-modal-body {
        padding: 20px;
    }
    
    .blog-modal-body h2 {
        font-size: 1.4rem;
    }
}
