/* ============================================
   R&D FABTECH ENGINEERS - BASE STYLES
   Common styles across all pages
   ============================================ */

/* === ROOT VARIABLES === */
:root {
    --primary-blue: #1B4F72;
    --secondary-cyan: #0f8ca5;
    --accent-teal: #1ABC9C;
    --dark-blue: #0D2A3F;
    --light-grey: #F8F9FA;
    --medium-grey: #E9ECEF;
    --text-dark: #2C3E50;
    --text-medium: #5A6C7D;
    --text-light: #7B8794;
    --white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --transition-fast: all 0.2s ease;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 10px;
    --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Montserrat', 'Roboto', sans-serif;
}

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1.2rem;
    color: var(--text-medium);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; }

/* === UTILITY CLASSES === */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-fluid {
    width: 100%;
    padding: 0;
}

.section-padding { padding: 100px 0; }
.section-padding-sm { padding: 60px 0; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.bg-light { background: var(--light-grey); }
.bg-white { background: var(--white); }

.lead {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-medium);
    line-height: 1.8;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: var(--transition-smooth);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-cyan), #00B8E6);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(27, 79, 114, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(27, 79, 114, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-light {
    background: var(--white);
    color: var(--primary-blue);
}

.btn-light:hover {
    background: var(--light-grey);
}

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary-blue);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 10px 24px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* === HEADER & NAVIGATION === */
.header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-smooth);
}

.navbar {
    padding: 18px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 55px;
    width: auto;
    transition: var(--transition-fast);
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 4px;
    position: relative;
    transition: var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--secondary-cyan);
    transition: var(--transition-smooth);
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary-cyan);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.btn-call {
    background: var(--secondary-cyan);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.25);
}

.btn-call:hover {
    background: #00B8E6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.35);
}

.nav-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-blue);
    background: none;
    border: none;
    padding: 8px;
}

/* === SECTION HEADER === */
.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.section-title {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-cyan), var(--accent-teal));
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-medium);
    font-size: 1.15rem;
    line-height: 1.8;
}

/* === PAGE HEADER === */
.page-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(0,212,255,0.2)"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.4;
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-header h1 {
    color: var(--white);
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.page-header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
}

/* === FOOTER === */
.footer {
    background: var(--primary-blue);
    color: var(--white);
    padding: 70px 0 30px;
}

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

.footer-logo {
    height: 55px;
    margin-bottom: 20px;
}

.footer-col p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 25px;
    line-height: 1.8;
}

.footer-col h3 {
    color: var(--secondary-cyan);
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.8);
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
}

.footer-col ul li a:hover {
    color: var(--secondary-cyan);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: rgba(0, 212, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.social-links a:hover {
    background: var(--secondary-cyan);
    border-color: var(--white);
    transform: translateY(-5px) rotate(360deg);
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.8);
}

.contact-info i {
    color: var(--secondary-cyan);
    margin-top: 4px;
    font-size: 1.1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 35px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
}

/* === FLOATING BUTTONS === */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--white);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition-smooth);
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.15);
    background: #1fb855;
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7); }
}

.chatbot-button {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--secondary-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: var(--transition-smooth);
}

.chatbot-button:hover {
    transform: scale(1.15) rotate(15deg);
    background: #00B8E6;
}

/* === CHATBOT MODAL === */
.chatbot-modal {
    position: fixed;
    bottom: 190px;
    right: 30px;
    width: 380px;
    max-height: 550px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-modal.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: var(--white);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    color: var(--white);
    margin: 0;
    font-size: 1.1rem;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    transform: rotate(90deg);
}

.chatbot-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: var(--light-grey);
}

.chat-message {
    margin-bottom: 20px;
    animation: messageIn 0.3s ease;
}

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

.bot-message p {
    background: var(--white);
    padding: 14px 18px;
    border-radius: 12px 12px 12px 4px;
    display: inline-block;
    max-width: 85%;
    box-shadow: var(--shadow-sm);
}

.user-message p {
    background: var(--secondary-cyan);
    color: var(--white);
    padding: 14px 18px;
    border-radius: 12px 12px 4px 12px;
    display: inline-block;
    max-width: 85%;
    margin-left: auto;
    text-align: right;
}

.quick-replies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.quick-reply {
    background: var(--white);
    color: var(--secondary-cyan);
    border: 2px solid var(--secondary-cyan);
    padding: 12px 18px;
    border-radius: 20px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
    font-weight: 500;
}

.quick-reply:hover {
    background: var(--secondary-cyan);
    color: var(--white);
    transform: translateX(5px);
}

.chatbot-footer {
    padding: 20px;
    border-top: 1px solid var(--medium-grey);
    display: flex;
    gap: 12px;
    background: var(--white);
}

#chatInput {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--medium-grey);
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

#chatInput:focus {
    outline: none;
    border-color: var(--secondary-cyan);
}

#chatSend {
    background: var(--secondary-cyan);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.1rem;
}

#chatSend:hover {
    background: #00B8E6;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .section-padding { padding: 70px 0; }
    .nav-menu { gap: 25px; }
}

@media (max-width: 968px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 30px 20px;
        box-shadow: var(--shadow-lg);
        display: none;
        gap: 20px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link::after {
        display: none;
    }

    .chatbot-modal {
        right: 10px;
        left: 10px;
        width: auto;
    }

    .whatsapp-float,
    .chatbot-button {
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
    }
}

@media (max-width: 640px) {
    .section-padding { padding: 50px 0; }
    .page-header { padding: 100px 0 60px; }
    .footer-grid { gap: 40px; }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 14px 30px;
        font-size: 1rem;
    }
}

/* === SCROLL ANIMATIONS === */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
