:root {
    --primary-color: #1B5E20; /* Islamic Green */
    --navy-color: #2E7D32;    /* Deep Green */
    --accent-color: #C8A951;  /* Gold accent */
    --light-bg: #ffffff;
    --chat-bg: #f0f5f0;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: #f5f7fa;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Floating Chat Interface (Bottom Right) */
#chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.whatsapp-bubble,
.chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-bubble {
    background-color: #25D366;
    color: white;
    text-decoration: none;
}

.whatsapp-bubble:hover,
.chat-bubble:hover {
    transform: scale(1.05);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: 0.3s ease;
    border: 1px solid #eee;
}

.chat-window.hidden {
    display: none;
}

/* Chat Header */
.chat-header {
    background: var(--navy-color);
    padding: 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info { display: flex; align-items: center; gap: 10px; }

.bot-avatar { 
    width: 35px; 
    height: 35px; 
    border-radius: 50%; 
    background: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-avatar img { width: 100%; height: auto; object-fit: contain; }

.title-wrapper h3 { font-size: 0.95rem; margin: 0; }
.status { font-size: 0.7rem; opacity: 0.8; display: flex; align-items: center; gap: 4px; }
.status i { color: #4caf50; font-size: 0.5rem; }

.close-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--chat-bg);
}

.message {
    padding: 10px 14px;
    border-radius: 10px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bot-message {
    background-color: white;
    color: #333;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-message {
    background-color: var(--navy-color);
    color: white;
    align-self: flex-end;
}

.sources-list {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

.sources-list hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #eee;
}

.sources-list ol {
    margin-left: 20px;
    padding-left: 0;
    list-style-type: decimal;
}

.sources-list li {
    margin-top: 4px;
}


/* Chat Input */
.chat-input-area {
    padding: 15px;
    background: white;
    display: flex;
    gap: 8px;
    border-top: 1px solid #eee;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
}

.chat-input-area button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-in {
    animation: fadeIn 0.3s ease;
}

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

/* Floating Evaluation Link Button */
.eval-link-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 999;
    background: var(--accent-color);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(200, 169, 81, 0.3);
    transition: all 0.3s ease;
}

.eval-link-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(200, 169, 81, 0.4);
    background: #b89840;
}

.eval-link-btn i {
    font-size: 1rem;
}

.eval-link-btn span {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .eval-link-btn span {
        display: none;
    }
    
    .eval-link-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
}

/* ==================== HOMEPAGE STYLES ==================== */

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--navy-color));
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-section i {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.logo-section h1 {
    font-size: 1.5rem;
    margin: 0;
}

.logo-section p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background: var(--accent-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f0f5f0 0%, #e8f5e9 100%);
    padding: 4rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-desc {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 2rem;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.feature-item i {
    font-size: 1.2rem;
}

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

.cta-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    margin: 10px 0;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.3);
}

.cta-button:hover {
    background: var(--navy-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(27, 94, 32, 0.4);
}

.whatsapp-button {
    background: #25D366;
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-button:hover {
    background: #1DA851;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-icon {
    font-size: 15rem;
    color: var(--primary-color);
    opacity: 0.1;
}

/* Info Section */
.info-section {
    padding: 4rem 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.section-desc {
    text-align: center;
    max-width: 700px;
    margin: -2rem auto 3rem;
    color: #666;
    line-height: 1.7;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color);
}

.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.info-card p {
    color: #666;
    line-height: 1.6;
}

/* Kitab Rujukan */
.book-card {
    display: flex;
    flex-direction: column;
}

.book-card h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    line-height: 1.4;
    flex-grow: 1;
}

.book-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid var(--accent-color);
    transition: all 0.3s ease;
    align-self: center;
}

.book-link:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

/* Research Banner */
.research-banner {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    color: white;
    padding: 3.5rem 0;
    position: relative;
    overflow: hidden;
}

.research-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.03)"/></svg>');
    background-size: 100px 100px;
    opacity: 0.5;
}

.research-content {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.research-icon {
    flex-shrink: 0;
}

.research-icon i {
    font-size: 5rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 20px;
    display: block;
}

.research-text {
    flex: 1;
}

.research-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.research-badge i {
    font-size: 1rem;
}

.research-title {
    font-size: 1.6rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.research-meta {
    display: grid;
    gap: 1rem;
}

.meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 1.2rem;
    border-radius: 10px;
    line-height: 1.7;
    font-size: 0.95rem;
    border-left: 3px solid var(--accent-color);
}

.meta-item i {
    font-size: 1.2rem;
    margin-top: 0.2rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.meta-item strong {
    color: var(--accent-color);
    margin-right: 0.3rem;
}

.research-team {
    margin-top: 2rem;
}

.team-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
}

.team-member {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
}

.team-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    margin-bottom: 0.6rem;
}

.team-leader .team-photo {
    border-color: #ffffff;
}

.team-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.team-role {
    font-size: 0.8rem;
    color: var(--accent-color);
    opacity: 0.9;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.tech-list {
    list-style: none;
    padding: 0;
}

.tech-list li {
    padding: 0.4rem 0;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tech-list i {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    opacity: 0.8;
    margin: 0.5rem 0;
}

.footer-disclaimer {
    font-size: 0.9rem;
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.research-title-footer {
    color: var(--accent-color);
    margin-bottom: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        width: 100%;
    }
    
    .nav-link {
        flex: 1;
        justify-content: center;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .hero-text h2 {
        font-size: 1.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-button,
    .whatsapp-button {
        justify-content: center;
    }
    
    .hero-icon {
        font-size: 8rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .research-content {
        flex-direction: column;
        text-align: center;
    }
    
    .research-icon i {
        font-size: 3.5rem;
        padding: 1rem;
    }
    
    .research-title {
        font-size: 1.2rem;
    }
    
    .meta-item {
        flex-direction: column;
        text-align: left;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}