/* ========================================
   FOOTER CSS - LinkCodeAI
   ======================================== */

/* === VARIABLES === */
:root {
    --footer-bg: #0a1929;
    --footer-text: #ffffff;
    --green-primary: #10b981;
    --orange-button: #ff6b35;
    --orange-hover: #ff5722;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
}

/* ========================================
   MAIN FOOTER
   ======================================== */
.main-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 50px 0 30px;
    margin-top: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* === FOOTER TOP - SAME AS HEADER LAYOUT === */
.footer-top {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(200px, 1fr);
    align-items: center;
    gap: 20px;
}

/* === LEFT: LOGO + TEXT === */
.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo img {
    height: 40px;
    width: auto;
    transition: transform var(--transition);
}

.footer-logo a:hover img {
    transform: scale(1.05);
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

/* === CENTER: PAGE LINKS IN ONE LINE === */
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: nowrap;
}

.footer-links a {
    color: var(--footer-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-normal);
    position: relative;
    display: inline-block;
}

.footer-links a::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green-primary), var(--orange-button));
    transform: translateX(-50%);
    transition: width var(--transition-normal);
}

.footer-links a:hover {
    color: var(--green-primary);
    transform: translateY(-2px);
    text-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.footer-links a:hover::before {
    width: 100%;
}

/* === RIGHT: EMPTY (for future use) === */
.footer-right-space {
    /* Empty space to balance grid */
}

/* === SOCIAL ICONS - CENTERED BELOW === */
.footer-social {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding-top: 10px;
}

.footer-social .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    transition: all var(--transition);
    text-decoration: none;
}

.footer-social .social-icon svg {
    transition: transform var(--transition);
}

.footer-social .social-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.footer-social .social-icon:hover svg {
    transform: scale(1.1);
}

.footer-social .social-icon.facebook:hover {
    background-color: #1877F2;
}

.footer-social .social-icon.linkedin:hover {
    background-color: #0A66C2;
}

.footer-social .social-icon.twitter:hover {
    background-color: #1DA1F2;
}

.footer-social .social-icon.instagram:hover {
    background: linear-gradient(45deg, #FED576, #F47133, #BC3081);
}

.footer-social .social-icon.youtube:hover {
    background-color: #FF0000;
}

/* === COPYRIGHT === */
.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ========================================
   BACK TO TOP BUTTON - ORANGE GRADIENT
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--orange-button), var(--orange-hover));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all var(--transition-normal);
    z-index: 997;
    position: fixed !important;
    overflow: hidden;
}

.back-to-top::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--transition-slow), height var(--transition-slow);
}

.back-to-top:hover::before {
    width: 100%;
    height: 100%;
}

.back-to-top.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--orange-hover), #e64a19);
    transform: translateY(-5px) scale(1.1) !important;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.7);
}

.back-to-top:active {
    transform: translateY(-3px) scale(1.05) !important;
}

/* Back to Top Icon Animation */
@keyframes floatUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.back-to-top.visible svg {
    animation: floatUp 1.5s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.back-to-top:hover svg {
    animation: none;
    transform: translateY(-3px) scale(1.1);
}

/* ========================================
   CHATBOT TOGGLE BUTTON
   ======================================== */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--orange-button), var(--orange-hover));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    transition: all var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}

.chatbot-toggle .close-icon {
    display: none;
}

.chatbot-toggle.active .chat-icon {
    display: none;
}

.chatbot-toggle.active .close-icon {
    display: block;
}

/* Pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

.chatbot-toggle {
    animation: pulse 2s infinite;
}

.chatbot-toggle:hover,
.chatbot-toggle.active {
    animation: none;
}

/* ========================================
   CHATBOT PANEL
   ======================================== */
.chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 340px;
    max-width: calc(100vw - 40px);
    height: 450px;
    background-color: white;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition);
    z-index: 998;
    overflow: hidden;
}

.chatbot-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* === CHATBOT HEADER === */
.chatbot-header {
    background: linear-gradient(135deg, var(--green-primary), #059669);
    color: white;
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: transform var(--transition);
}

.chatbot-close:hover {
    transform: rotate(90deg);
}

/* === CHATBOT MESSAGES === */
.chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 75%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.bot-message .message-content {
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.user-message .message-content {
    background-color: var(--green-primary);
    color: white;
}

.message-time {
    font-size: 10px;
    color: #999;
    padding: 0 4px;
}

/* === CHATBOT INPUT === */
.chatbot-input-area {
    padding: 12px 15px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition);
}

.chatbot-input:focus {
    border-color: var(--green-primary);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    background-color: var(--green-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.chatbot-send:hover {
    background-color: #059669;
    transform: scale(1.08);
}

/* === QUICK ACTIONS === */
.chatbot-quick-actions {
    padding: 8px 15px 12px;
    background-color: white;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 6px 14px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.quick-action-btn:hover {
    background-color: var(--green-primary);
    color: white;
    border-color: var(--green-primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Large Desktop */
@media (min-width: 1200px) {
    .footer-links {
        gap: 28px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .footer-top {
        grid-template-columns: auto 1fr auto;
    }
    
    .footer-links {
        gap: 18px;
    }
    
    .footer-links a {
        font-size: 14px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .main-footer {
        padding: 30px 0 20px;
    }
    
    .footer-content {
        gap: 25px;
    }
    
    .footer-top {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-logo {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .footer-logo img {
        height: 35px;
    }
    
    .footer-tagline {
        font-size: 13px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 15px;
    }
    
    .footer-links a {
        font-size: 13px;
    }
    
    .footer-social {
        gap: 12px;
    }
    
    .footer-social .social-icon {
        width: 40px;
        height: 40px;
    }
    
    .back-to-top {
        bottom: 85px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
    }
    
    .chatbot-panel {
        bottom: 85px;
        right: 20px;
        width: calc(100vw - 40px);
        height: 420px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.back-to-top:focus-visible,
.chatbot-toggle:focus-visible,
.chatbot-close:focus-visible,
.chatbot-send:focus-visible,
.footer-links a:focus-visible {
    outline: 2px solid var(--green-primary);
    outline-offset: 2px;
}

/* Scrollbar styling for chat */
.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}