/* ===== DARK MODE VARIABLES ===== */
:root {
    /* Light theme (default) */
    --primary-blue: #003366;
    --secondary-grey: #555555;
    --light-grey: #f8f9fa;

    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #555555;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark theme variables */
    --primary-blue: #3b82f6;
    --secondary-grey: #94a3b8;
    --light-grey: #1e293b;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --card-bg: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* ======= Global Styles ======= */
body {
    font-family: 'Roboto', sans-serif;
    padding-top: 80px; /* For fixed navbar */
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bg-dark-blue {
    background-color: var(--primary-blue);
}

/* ======= Hero Banner ======= */
.hero-banner {
    padding: 100px 0;
    background-color: var(--light-grey);
}

.hero-banner h1 {
    font-weight: 700;
    color: var(--primary-blue);
}

/* ======= WhatsApp Float Button ======= */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ======= Theme Toggle Button ======= */
.theme-toggle-container {
    position: relative;
    margin-left: 15px;
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.theme-toggle-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

.theme-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-icon {
    transform: rotate(180deg);
}

/* ======= Services Page Specific Styles ======= */
.service-icon {
    color: var(--primary-blue);
}

.process-step {
    padding: 20px;
    border-radius: 5px;
    background: var(--card-bg);
    height: 100%;
    box-shadow: 0 2px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-weight: bold;
    font-size: 1.5rem;
}

/* ======= About Page Specific Styles ======= */
.company-story p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.achievement-box {
    background-color: var(--light-grey);
    border-radius: 5px;
    border-left: 4px solid var(--primary-blue);
    color: var(--text-primary);
}

.founder-section ul {
    list-style-type: none;
    padding-left: 0;
}

.founder-section ul li:before {
    content: "✓";
    color: var(--primary-blue);
    font-weight: bold;
    margin-right: 10px;
}

.founder-section ul li {
    color: var(--text-secondary);
}

.icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

blockquote {
    border-left: 4px solid var(--primary-blue);
    padding-left: 20px;
    font-style: italic;
    color: var(--text-secondary);
}

/* ===== Improved Loader Styles ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.95);
}

.bearing-loader {
    position: relative;
    width: 120px;
    height: 120px;
}

.outer-ring {
    width: 100%;
    height: 100%;
    border: 10px solid rgba(0, 51, 102, 0.2);
    border-radius: 50%;
    position: relative;
    animation: rotate 3s linear infinite;
}

[data-theme="dark"] .outer-ring {
    border-color: rgba(59, 130, 246, 0.3);
}

.ball {
    width: 18px;
    height: 18px;
    background: var(--primary-blue);
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 10px rgba(0, 51, 102, 0.5);
}

[data-theme="dark"] .ball {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.ball:nth-child(1) { top: -9px; left: 50%; transform: translateX(-50%); }
.ball:nth-child(2) { right: -9px; top: 50%; transform: translateY(-50%); }
.ball:nth-child(3) { bottom: -9px; left: 50%; transform: translateX(-50%); }
.ball:nth-child(4) { left: -9px; top: 50%; transform: translateY(-50%); }

.inner-ring {
    position: relative;
    top: -50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75px;
    height: 75px;
    border: 8px solid var(--secondary-grey);
    border-radius: 50%;
}

.loading-text {
    color: var(--primary-blue);
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.1rem;
}

.bearing-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    opacity: 0.9;
    animation: pulse 2s infinite alternate;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.95); }
    100% { transform: translate(-50%, -50%) scale(1.05); }
}

/* ======= Product Cards ======= */
.product-card {
    transition: transform 0.3s ease;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.product-specs {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.product-specs strong {
    color: var(--primary-blue);
}

/* ======= Category Filter ======= */
.category-filter {
    transition: all 0.3s ease;
    margin-bottom: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.category-filter.active {
    background: var(--primary-blue);
    color: white;
}

.category-section {
    display: none;
}

.category-section.active {
    display: block;
}

/* ======= Navbar Dark Mode ======= */
.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand, .nav-link {
    color: var(--text-primary) !important;
}

.navbar-toggler {
    border-color: var(--border-color);
    margin-left: auto;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 51, 102, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28241, 245, 249, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== Smooth transitions for all elements ===== */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ======= Responsive Adjustments ======= */
@media (max-width: 992px) {
    .navbar-brand {
        display: flex;
        align-items: center;
        flex-grow: 1;
    }
    .navbar-toggler {
        order: 2;
        margin-left: auto;
        padding: 0.25rem 0.5rem;
    }
    .navbar-collapse {
        flex-basis: 100%;
        order: 3;
    }
    .navbar-brand img {
        height: 30px;
        margin-right: 10px;
    }
    .navbar-brand span {
        font-size: 1.1rem;
        white-space: nowrap;
    }
    .navbar-nav {
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }
    .nav-item {
        margin: 5px 0;
    }
    .nav-link {
        padding: 8px 15px;
    }
}

@media (max-width: 768px) {
    .navbar-collapse {
        background: var(--primary-blue);
        padding: 15px;
        border-radius: 5px;
    }
    .navbar-nav {
        gap: 10px;
    }
    .hero-banner {
        padding: 60px 0;
        text-align: center;
    }
    .founder-section .row {
        flex-direction: column-reverse;
    }
    .founder-section img {
        max-width: 200px;
        margin: 0 auto 20px;
    }
    .testimonial-card {
        margin: 0 10px;
        padding: 15px;
        background: var(--card-bg);
    }
    .testimonial-text {
        font-size: 0.9rem;
        color: var(--text-secondary);
    }
    .company-story .row {
        flex-direction: column;
    }
    .company-story img {
        margin-top: 20px;
    }
    blockquote {
        font-size: 1rem;
        padding: 10px 15px;
    }
    .icon-box {
        width: 60px;
        height: 60px;
    }
    .icon-box i {
        font-size: 1.5rem;
    }
    .timeline-item {
        flex-direction: column;
        padding-left: 0;
    }
    .timeline-date {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 576px) {
    .contact-section .card-body {
        padding: 15px;
    }
    input, textarea, select {
        font-size: 16px;
        background-color: var(--card-bg);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    .product-card {
        width: 100%;
        margin-bottom: 20px;
    }
    .navbar-brand img {
        height: 30px;
    }
    .whatsapp-float {
        bottom: 70px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    .bearing-loader {
        width: 80px;
        height: 80px;
    }
    .inner-ring {
        width: 30px;
        height: 30px;
    }
    .achievement-box {
        margin-bottom: 15px;
    }
    .achievement-box h3 {
        font-size: 1.5rem;
    }
}
