/**
 * Phonna Raya Heavy Industries - Clean Professional Design System
 * Navy + Blue Accent | Simple & Clean
 */

/* ============================================
   Theme Variables - Dark Mode (Default for header/footer)
   ============================================ */
:root {
    /* Dark theme (header, footer, hero sections) */
    --navy: #0f172a;
    --navy-light: #1e293b;
    --navy-dark: #020617;

    /* Accent */
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #3b82f6;
    --accent-bg: rgba(37, 99, 235, 0.08);
    --accent-border: rgba(37, 99, 235, 0.2);

    /* Light mode (content area - default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-faint: #cbd5e1;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Light Theme
   ============================================ */
.light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-faint: #cbd5e1;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Dark Theme (applied via .dark on html or .light removed)
   ============================================ */
html:not(.light) {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #162032;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-faint: #475569;
    --border-color: rgba(148, 163, 184, 0.12);
    --border-hover: rgba(148, 163, 184, 0.2);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Product card name: black in dark mode */
html:not(.light) .product-name {
    color: #000000 !important;
}

/* ============================================
   Base & Reset
   ============================================ */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Theme transition */
.theme-transitioning,
.theme-transitioning * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ============================================
   Custom Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================
   Navigation Links (Desktop)
   ============================================ */
.nav-link {
    position: relative;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: #3b82f6;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.25rem;
    height: 2px;
    background: #3b82f6;
    border-radius: 9999px;
}

/* ============================================
   Mobile Navigation Links
   ============================================ */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    transition: all 0.15s;
    text-decoration: none;
}
.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* ============================================
   Dropdown Items
   ============================================ */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.15s;
    text-decoration: none;
}
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* ============================================
   Footer Links
   ============================================ */
.footer-link {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.15s;
    text-decoration: none;
}
.footer-link:hover {
    color: #3b82f6;
}

/* ============================================
   Product Cards
   ============================================ */
.product-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.25s;
    box-shadow: var(--card-shadow);
}
.product-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* ============================================
   Content Cards (replaces glass)
   ============================================ */
.content-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.25s;
}
.content-card:hover {
    box-shadow: var(--card-shadow-hover);
}

/* ============================================
   Glass replacement - now just a clean card
   ============================================ */
.glass {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
}

/* ============================================
   Gradient Industrial (hero/section bg)
   ============================================ */
.gradient-industrial {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1a2744 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* ============================================
   Section Page Hero (breadcrumb + title)
   ============================================ */
.page-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    background: transparent;
    border: 1px solid #2563eb;
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}
.btn-outline:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* ============================================
   Form Inputs
   ============================================ */
.form-input {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   FAQ Accordion
   ============================================ */
.faq-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s;
}
.faq-item:hover {
    border-color: var(--border-hover);
}
.faq-answer {
    color: var(--text-secondary);
    line-height: 1.7;
}
.faq-arrow {
    transition: transform 0.3s;
}
.faq-arrow.rotate-180 {
    transform: rotate(180deg);
}

/* ============================================
   Stat Counter Cards
   ============================================ */
.stat-card {
    padding: 1rem;
}
.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #2563eb;
}
.stat-card .stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Badge
   ============================================ */
.badge-pulse {
    animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slideDown {
    animation: slideDown 0.2s ease-out;
}

/* ============================================
   Image Placeholder
   ============================================ */
.img-placeholder {
    background: var(--bg-tertiary);
}

/* ============================================
   Label Badges
   ============================================ */
.label-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.label-badge-new {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.2);
}
.label-badge-sale {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.label-badge-popular {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    animation: slideIn 0.3s ease-out;
    max-width: 24rem;
}
.toast-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.toast-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.toast-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   Flash Messages
   ============================================ */
.flash-message {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 100;
    max-width: 24rem;
    animation: slideDown 0.3s ease-out;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--text-secondary);
}
.pagination a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.pagination .active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   Section content area styling
   ============================================ */
.section-content {
    background: var(--bg-primary);
    min-height: 60vh;
}

/* Content text colors that respect theme */
.section-content h1,
.section-content h2,
.section-content h3,
.section-content h4 {
    color: var(--text-primary);
}
.section-content p,
.section-content li,
.section-content td,
.section-content th {
    color: var(--text-secondary);
}

/* ============================================
   Responsive helpers
   ============================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Back to top button
   ============================================ */
#backToTop {
    opacity: 0;
    transform: translateY(1rem);
    pointer-events: none;
    transition: all 0.3s;
}
#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ============================================
   Admin & Customer specific overrides
   ============================================ */
/* Admin sidebar link */
.sidebar-link {
    transition: all 0.15s ease;
}
.sidebar-link:hover {
    background: rgba(37, 99, 235, 0.08);
}
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #2563eb;
    color: #3b82f6;
}

/* Tab buttons */
.tab-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active,
.tab-btn.border-accent {
    color: #2563eb;
    border-bottom-color: #2563eb;
}