/* Master Theme CSS - MeBid Theme Aligned & Mobile Friendly */

/* ===== CSS VARIABLES ===== */
:root {
    /* Original MeBid Theme Colors */
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #66b3ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 3rem;
    
    /* Borders & Shadows */
    --border-radius: 0.375rem;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --box-shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    
    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TOP BAR ===== */
.top-bar {
    background: var(--light-color);
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.top-bar-left a,
.top-bar-right a {
    color: #666;
    text-decoration: none;
    margin-right: 15px;
    transition: var(--transition-base);
}

.top-bar-left a:hover,
.top-bar-right a:hover {
    color: var(--primary-color);
}

.top-bar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.top-bar-right .dropdown {
    margin-left: 15px;
}

/* ===== NAVIGATION ===== */
.navbar {
    box-shadow: var(--box-shadow);
    padding: 15px 0;
    background: #fff;
}

.navbar-brand h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-nav .nav-link {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition-base);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

/* ===== HERO SECTIONS ===== */
.hero-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
    color: #1a202c;
    padding: 100px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::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"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23e2e8f0" opacity="0.3"/><circle cx="75" cy="75" r="1" fill="%23e2e8f0" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.hero-content h1 {
    font-weight: 700;
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #1a202c;
}

.hero-content .lead {
    font-size: 1.25rem;
    color: #4a5568;
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-buttons .btn {
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition-base);
    margin-right: 1rem;
}

.hero-buttons .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.hero-buttons .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

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

.hero-buttons .btn-outline-primary:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.hero-image img {
    border-radius: 1rem;
    box-shadow: var(--box-shadow-lg);
    transition: var(--transition-base);
}

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

/* ===== PAGE HEADERS ===== */
.page-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
}

.page-title {
    font-weight: 700;
    font-size: 2.5rem;
    color: #1a202c;
    margin-bottom: 1rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
}

.breadcrumb-item.active {
    color: #4a5568;
    font-weight: 500;
}

/* ===== CARDS ===== */
.card {
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition-base);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-bottom: none;
}

.card-body {
    padding: 1.5rem;
}

/* ===== TABLES ===== */
.table {
    margin-bottom: 0;
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    border-top: none;
}

.table td,
.table th {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-borderless td,
.table-borderless th {
    border: none;
}

/* ===== FORMS ===== */
.form-control {
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition-base);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition-base);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background: #1e7e34;
    border-color: #1e7e34;
}

/* ===== BADGES ===== */
.badge {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.badge.bg-primary {
    background: var(--primary-color) !important;
}

.badge.bg-success {
    background: var(--success-color) !important;
}

/* ===== ALERTS ===== */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-dismissible .btn-close {
    padding: 1rem 1rem;
}

/* ===== SECTIONS ===== */
section {
    padding: var(--spacing-xl) 0;
}

section.py-5 {
    padding: 3rem 0;
}

section.py-3 {
    padding: 1rem 0;
}

.bg-light {
    background-color: var(--light-color) !important;
}

.bg-white {
    background-color: #fff !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center !important;
}

.text-muted {
    color: #6c757d !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 1200px) {
    .hero-content h1 {
        font-size: 3rem;
    }
}

@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding: 80px 0 60px;
    }
    
    .page-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    /* Hide top bar on mobile */
    .top-bar {
        display: none;
    }
    
    /* Hero section mobile */
    .hero-section {
        padding: 60px 0 40px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .hero-content .lead {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin-right: 0;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .hero-image img {
        margin-top: 2rem;
    }
    
    /* Page header mobile */
    .page-header {
        padding: 2rem 0;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    /* Cards mobile */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Forms mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
    }
    
    /* Tables mobile */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    /* Buttons mobile */
    .btn {
        min-height: 44px; /* iOS touch target minimum */
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Alerts mobile */
    .alert {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    /* Sections mobile */
    section {
        padding: 2rem 0;
    }
    
    section.py-5 {
        padding: 2rem 0;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    .hero-buttons .btn {
        width: auto;
        min-width: 150px;
        margin-right: 0.5rem;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    /* Disable animations on mobile for better performance */
    .aos-animate {
        animation: none !important;
    }
    
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Reduce font weights for better rendering */
    body {
        font-weight: 400;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-weight: 600;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img,
    .product-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: -webkit-crisp-edges;
        image-rendering: crisp-edges;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== MANUFACTURING LOGO STYLING ===== */
.manufacturing-logo {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.plant-logo-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

.plant-logo {
    max-height: 120px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition-base);
}

.plant-logo-link:hover .plant-logo {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.plant-logo-caption {
    margin-top: 0.5rem;
    text-align: center;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition-base);
}

.plant-logo-link:hover .plant-logo-caption {
    opacity: 1;
    transform: translateY(0);
}

.plant-logo-action {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    opacity: 0;
    transform: translateY(-5px);
    transition: var(--transition-base);
}

.plant-logo-link:hover .plant-logo-action {
    opacity: 1;
    transform: translateY(0);
}

.plant-logo-action i {
    margin-right: 0.25rem;
}

/* Mobile responsiveness for manufacturing logo */
@media (max-width: 992px) {
    .plant-logo {
        max-height: 100px;
    }
    
    .plant-logo-caption small {
        font-size: 0.8rem;
    }
    
    .plant-logo-action {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .manufacturing-logo {
        text-align: center;
        margin-top: 1rem;
    }
    
    .plant-logo {
        max-height: 80px;
    }
    
    .plant-logo-caption small {
        font-size: 0.75rem;
    }
    
    .plant-logo-action {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .plant-logo {
        max-height: 60px;
    }
    
    .plant-logo-caption {
        margin-top: 0.25rem;
    }
    
    .plant-logo-caption small {
        font-size: 0.7rem;
    }
    
    .plant-logo-action {
        font-size: 0.6rem;
        margin-top: 0.15rem;
    }
}

/* ===== LOGO STYLING ===== */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--transition-base);
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-brand img {
    height: 60px;
    width: auto;
    margin-right: 0;
    transition: var(--transition-base);
    /* Logo rendering optimizations */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.navbar-brand .brand-text h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

.navbar-brand .brand-text small {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 2px;
}

/* Logo responsiveness */
@media (max-width: 992px) {
    .navbar-brand img {
        height: 50px;
    }
    
    .navbar-brand .brand-text h2 {
        font-size: 1.5rem;
    }
    
    .navbar-brand .brand-text small {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .navbar-brand img {
        height: 45px;
    }
    
    .navbar-brand .brand-text h2 {
        font-size: 1.3rem;
    }
    
    .navbar-brand .brand-text small {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 40px;
    }
    
    .navbar-brand .brand-text h2 {
        font-size: 1.2rem;
    }
    
    .navbar-brand .brand-text small {
        font-size: 0.6rem;
    }
}

/* Logo-only version for mobile */
@media (max-width: 480px) {
    .navbar-brand .brand-text {
        display: none;
    }
    
    .navbar-brand img {
        height: 35px;
    }
}

/* ===== FOCUS STATES ===== */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 999;
    transition: var(--transition-base);
    box-shadow: var(--box-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 80px;
        left: 20px;
        font-size: 1rem;
    }
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.whatsapp-float-enhanced {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    z-index: 1000;
    transition: var(--transition-base);
    overflow: visible;
    box-shadow: var(--box-shadow-lg);
}

.whatsapp-float-enhanced:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    background: #128C7E;
}

.whatsapp-float-enhanced i {
    font-size: 1.5rem;
    z-index: 2;
}

.whatsapp-text {
    position: absolute;
    right: 70px;
    background: #25D366;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition-base);
    pointer-events: none;
}

.whatsapp-float-enhanced:hover .whatsapp-text {
    opacity: 1;
    transform: translateX(0);
}

.whatsapp-tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #333;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-base);
    pointer-events: none;
    z-index: 1001;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 5px solid transparent;
    border-top-color: #333;
}

.whatsapp-float-enhanced:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse animation for WhatsApp button */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-float-enhanced {
    animation: whatsapp-pulse 2s infinite;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .whatsapp-float-enhanced {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-float-enhanced i {
        font-size: 1.2rem;
    }
    
    .whatsapp-text {
        display: none;
    }
    
    .whatsapp-tooltip {
        display: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .top-bar,
    .navbar,
    .hero-buttons,
    .btn,
    .whatsapp-float-enhanced,
    .back-to-top {
        display: none !important;
    }
    
    .hero-section {
        background: #fff !important;
        color: #000 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}
