/* style.css - Global Base Styles for HSE Calculator */
/* This file contains ONLY global styles, layout, and components */

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

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

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

button, input, select, textarea {
    font-family: inherit;
}

/* ===== CSS VARIABLES (Design System) ===== */
:root {
    /* Color Palette - Professional Safety Theme */
    --primary-color: #2c5aa0;
    --primary-dark: #1a3a6e;
    --secondary-color: #4caf50;
    --accent-color: #ff9800;
    --danger-color: #f44336;
    --warning-color: #ffc107;
    --success-color: #4caf50;
    --info-color: #3498db;
    --dark-color: #333333;
    --light-color: #f5f7fa;
    --text-color: #444444;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --gray-light: #f8f9fa;
    --gray: #6c757d;
    --gray-dark: #343a40;
    
    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, #2c5aa0, #1a3a6e);
    --gradient-success: linear-gradient(135deg, #4caf50, #2e7d32);
    --gradient-warning: linear-gradient(135deg, #ff9800, #f57c00);
    --gradient-danger: linear-gradient(135deg, #f44336, #d32f2f);
    --gradient-purple: linear-gradient(135deg, #667eea, #764ba2);
    --gradient-orange: linear-gradient(135deg, #ff9966, #ff5e62);
    
    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Segoe UI', sans-serif;
    --font-mono: 'Consolas', 'Monaco', monospace;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-round: 50%;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.1);
    --shadow-xl: 0 10px 25px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ===== SKIP TO MAIN CONTENT (Accessibility) ===== */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark-color);
    margin-bottom: var(--spacing-sm);
}

h1 { 
    font-size: 2.5rem; 
    line-height: 1.2;
}

h2 { 
    font-size: 2rem; 
    line-height: 1.25;
}

h3 { 
    font-size: 1.75rem; 
    line-height: 1.3;
}

h4 { 
    font-size: 1.5rem; 
    line-height: 1.35;
}

h5 { 
    font-size: 1.25rem; 
    line-height: 1.4;
}

h6 { 
    font-size: 1rem; 
    line-height: 1.45;
}

p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.text-lead {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--gray-dark);
}

.text-muted {
    color: var(--gray);
    opacity: 0.8;
}

.text-small {
    font-size: 0.875rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* ===== LINKS ===== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== LAYOUT CONTAINERS ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

.section-sm {
    padding: var(--spacing-lg) 0;
}

.section-lg {
    padding: var(--spacing-xxl) 0;
}

/* ===== HEADER & NAVIGATION ===== */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    padding: var(--spacing-sm) 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(44, 90, 160, 0.1);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-primary);
}

.btn i {
    font-size: 1.1em;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #3d8b40;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
    font-weight: bold;
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-coffee {
    background-color: #ffdd00;
    color: #5c3c00;
    font-weight: bold;
    border-color: #ffdd00;
}

.btn-coffee:hover {
    background-color: #e6c700;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== HERO SECTIONS ===== */
.hero {
    background: var(--gradient-primary);
    color: var(--white);
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::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 1000 100" preserveAspectRatio="none"><path d="M0,0V100H1000V0C800,50 200,50 0,0Z" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat bottom;
    background-size: 100% auto;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin: 0 auto var(--spacing-lg);
    opacity: 0.9;
    max-width: 700px;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    height: 100%;
}

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

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: var(--gray-light);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ===== GRID SYSTEM ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--spacing-md));
}

.col {
    flex: 1;
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== VISITOR COUNTER ===== */
.visitor-counter {
    padding: var(--spacing-lg) 0;
}

.counter-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    max-width: 400px;
    margin: 0 auto;
}

.counter-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

.counter-content h3 {
    margin-bottom: 5px;
}

.counter-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* ===== CALCULATOR CARDS (Global) ===== */
.section-title {
    text-align: center;
    margin-bottom: var(--spacing-sm);
    position: relative;
    padding-bottom: var(--spacing-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: var(--spacing-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.calculator-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.calculator-icon {
    background: var(--gradient-primary);
    color: var(--white);
    padding: var(--spacing-lg);
    text-align: center;
    font-size: 2.5rem;
}

.calculator-content {
    padding: var(--spacing-lg);
}

.calculator-content h3 {
    margin-bottom: var(--spacing-sm);
}

.calculator-content p {
    color: var(--gray);
    margin-bottom: var(--spacing-md);
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: auto;
}

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

.footer-col h4 {
    color: var(--white);
    margin-bottom: var(--spacing-md);
    font-size: 1.2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.footer p {
    opacity: 0.8;
    margin-bottom: var(--spacing-md);
}

.footer-social {
    display: flex;
    gap: var(--spacing-sm);
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    transition: all var(--transition-normal);
}

.footer-social a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-col ul {
    list-style: none;
}

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

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-normal);
}

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

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--spacing-sm);
}

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

.footer-bottom p {
    margin-bottom: 5px;
}

/* ===== PRINT STYLES (Consolidated) ===== */
@media print {
    .no-print,
    .header,
    .hero,
    .visitor-counter,
    .amazon-banner,
    .support-section,
    .explore-tools,
    .social-sharing,
    .footer,
    .btn:not(.print-btn),
    .mobile-toggle,
    .nav-links,
    .hero-buttons {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .section-title::after {
        display: none;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .card,
    .calculator-form {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    table {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ===== SOCIAL SHARING ===== */
.social-sharing {
    margin-top: var(--spacing-xl);
}

.social-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.social-card h3 {
    color: var(--dark-color);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-card p {
    color: var(--gray);
    margin-bottom: var(--spacing-lg);
}

.social-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    transition: all var(--transition-normal);
    min-width: 140px;
}

.social-btn.facebook {
    background: #3b5998;
}

.social-btn.twitter {
    background: #1da1f2;
}

.social-btn.linkedin {
    background: #0077b5;
}

.social-btn.whatsapp {
    background: #25d366;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* ===============================
   Featured Products Section
   =============================== */

.featured-products {
    padding: 60px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
}

.featured-products .section-title {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 2.2rem;
}

.featured-products .section-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 40px;
    font-size: 1.1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.product-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-content h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1rem;
    line-height: 1.4;
    min-height: 48px;
}

.product-content .btn {
    align-self: flex-start;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .featured-products .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .featured-products {
        padding: 40px 0;
    }
    
    .featured-products .section-title {
        font-size: 1.6rem;
    }
    
    .featured-products .section-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
        gap: 15px;
    }
    
    .product-image {
        height: 200px;
    }
}

/* For exactly 6 products - if you want 2 rows of 3 */
@media (min-width: 993px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* For exactly 4 products - if you want 2 rows of 2 */
@media (max-width: 992px) and (min-width: 769px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Text Center Utility */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 30px;
}

/* Button Styles */
.btn-outline {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

.btn-primary.btn-small {
    background: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary.btn-small:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Product Image Fallback */
.product-image img[onerror] {
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img[onerror]::before {
    content: "Image";
    color: #7f8c8d;
    font-size: 0.9rem;
}
