/**
 * DAE-A Electronics Dark Mode Theme Styles
 * 다크 모드 테마 시스템 스타일
 */

/* =================================
   CSS Variables for Theme Colors
   ================================= */
:root {
    /* Light Theme (Default) */
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --tertiary-bg: #e9ecef;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-color: #4A6FA5;
    --accent-hover: #357ABD;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --card-bg: #ffffff;
    --section-alt-bg: #f8f9fa;
}

/* =================================
   Dark Theme Variables
   ================================= */
.theme-dark,
[data-theme="dark"] {
    /* Refined Dark Theme Colors */
    --primary-bg: #0f1419;
    --secondary-bg: #1a1f2e;
    --tertiary-bg: #232937;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-muted: #70757a;
    --border-color: #2f3541;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --accent-color: #6e9eff;
    --accent-hover: #5a8fee;
    --success-color: #34d058;
    --warning-color: #ffb700;
    --danger-color: #f85149;
    --info-color: #58c4dc;
    --card-bg: #1a1f2e;
    --section-alt-bg: #141922;
    
    /* Additional dark theme colors */
    --code-bg: #1e2329;
    --code-text: #ff6b6b;
    --link-color: #6e9eff;
    --link-hover: #96b7ff;
    
    /* Enhanced statistics colors */
    --stat-primary: #00d4ff;
    --stat-secondary: #6e9eff;
    --stat-accent: #ff6b9d;
    --stat-glow: rgba(0, 212, 255, 0.5);
}

/* =================================
   Theme Toggle Button
   ================================= */
.theme-toggle {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.theme-toggle:hover {
    background: var(--tertiary-bg);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.theme-toggle:active {
    transform: scale(0.95);
    transition: all 0.1s ease;
}

.theme-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* 버튼 상태별 스타일 */
.theme-toggle.theme-light {
    background: var(--card-bg);
    color: #fbbf24;
    border-color: var(--border-color);
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.2);
}

.theme-toggle.theme-dark {
    background: var(--card-bg);
    color: #60a5fa;
    border-color: var(--border-color);
    box-shadow: 0 4px 14px rgba(96, 165, 250, 0.2);
}

/* SVG 아이콘 스타일 */
.theme-toggle .theme-icon {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.theme-toggle:hover .theme-icon {
    transform: rotate(15deg) scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.theme-toggle.theme-dark:hover .theme-icon {
    transform: rotate(-15deg) scale(1.1);
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6));
}

.theme-toggle.theme-light:hover .theme-icon {
    transform: rotate(15deg) scale(1.1);
    filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.6));
}

/* =================================
   Global Dark Theme Styles
   ================================= */

/* Body and HTML */
.theme-dark,
.theme-dark body {
    background: var(--primary-bg);
    color: var(--text-primary);
}

/* Headers */
.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6 {
    color: var(--text-primary);
}

/* Paragraphs and text */
.theme-dark p {
    color: var(--text-secondary);
}

/* Links */
.theme-dark a {
    color: var(--link-color);
    text-decoration: none;
    position: relative;
}

.theme-dark a:hover {
    color: var(--link-hover);
}

/* Beautiful link underline animation */
.theme-dark p a::after,
.theme-dark li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--link-hover);
    transition: width 0.3s ease;
}

.theme-dark p a:hover::after,
.theme-dark li a:hover::after {
    width: 100%;
}

/* Navigation */
.theme-dark .navbar,
.theme-dark .header {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
}

.theme-dark .nav-link {
    color: var(--text-secondary);
}

.theme-dark .nav-link:hover,
.theme-dark .nav-link.active {
    color: var(--text-primary);
}

.theme-dark .nav-brand {
    color: var(--text-primary);
}

/* Buttons */
.theme-dark .btn {
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.theme-dark .btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    border-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(110, 158, 255, 0.25);
}

.theme-dark .btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-color) 100%);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(110, 158, 255, 0.35);
    transform: translateY(-1px);
}

/* Button ripple effect */
.theme-dark .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.theme-dark .btn:active::after {
    width: 300px;
    height: 300px;
}

.theme-dark .btn-outline {
    background: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.theme-dark .btn-outline:hover {
    background: var(--accent-color);
    color: #ffffff;
}

/* Cards and sections */
.theme-dark .card,
.theme-dark .feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
    backdrop-filter: blur(10px);
}

/* Enhanced card hover effects */
.theme-dark .card:hover,
.theme-dark .feature-card:hover,
.theme-dark .philosophy-item:hover,
.theme-dark .facility-item:hover {
    background: var(--tertiary-bg);
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(110, 158, 255, 0.15);
    transform: translateY(-2px);
}

/* Footer */
.theme-dark .footer {
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.theme-dark .footer h4 {
    color: var(--text-primary);
}

/* Forms */
.theme-dark input,
.theme-dark textarea,
.theme-dark select {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark input:focus,
.theme-dark textarea:focus,
.theme-dark select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

.theme-dark input::placeholder,
.theme-dark textarea::placeholder {
    color: var(--text-muted);
}

/* =================================
   Live Chat Dark Mode
   ================================= */
.theme-dark .livechat-widget .chat-bubble {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
}

.theme-dark .livechat-window {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .chat-header {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
}

.theme-dark .chat-body {
    background: var(--primary-bg);
}

.theme-dark .chat-messages {
    color: var(--text-primary);
}

.theme-dark .message.operator .message-content {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.theme-dark .chat-footer {
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
}

.theme-dark .input-wrapper {
    background: var(--tertiary-bg);
}

.theme-dark .input-wrapper:focus-within {
    background: var(--secondary-bg);
}

.theme-dark #chat-input {
    color: var(--text-primary);
}

.theme-dark .action-btn {
    background: var(--tertiary-bg);
    color: var(--text-secondary);
}

.theme-dark .action-btn:hover {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

/* =================================
   Back to Top Dark Mode
   ================================= */
.theme-dark .back-to-top {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
    border: 1px solid var(--border-color);
}

.theme-dark .back-to-top:hover {
    background: linear-gradient(135deg, var(--tertiary-bg) 0%, var(--secondary-bg) 100%);
    box-shadow: 0 6px 20px var(--shadow-color);
}

/* =================================
   Form Elements Dark Mode
   ================================= */

/* Form Labels and Legends */
.theme-dark label {
    color: var(--text-primary);
}

.theme-dark .form-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.theme-dark fieldset {
    border: 1px solid var(--border-color);
}

.theme-dark legend {
    color: var(--text-primary);
    background: var(--secondary-bg);
    padding: 0 10px;
}

/* Form Help Text and Errors */
.theme-dark .form-text,
.theme-dark .form-help,
.theme-dark .help-text {
    color: var(--text-muted);
}

.theme-dark .form-error,
.theme-dark .error-message,
.theme-dark .invalid-feedback {
    color: var(--danger-color);
}

.theme-dark .form-success,
.theme-dark .success-message,
.theme-dark .valid-feedback {
    color: var(--success-color);
}

/* Select Options */
.theme-dark option {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.theme-dark optgroup {
    background: var(--tertiary-bg);
    color: var(--text-primary);
}

/* =================================
   Text Elements Dark Mode
   ================================= */

/* Lists */
.theme-dark ul,
.theme-dark ol {
    color: var(--text-secondary);
}

.theme-dark li {
    color: var(--text-secondary);
}

/* Definition Lists */
.theme-dark dl {
    color: var(--text-secondary);
}

.theme-dark dt {
    color: var(--text-primary);
    font-weight: 600;
}

.theme-dark dd {
    color: var(--text-secondary);
}

/* Quotes and Citations */
.theme-dark blockquote {
    color: var(--text-secondary);
    border-left: 4px solid var(--accent-color);
    background: var(--secondary-bg);
    padding: 20px;
}

.theme-dark cite {
    color: var(--text-muted);
    font-style: italic;
}

.theme-dark q {
    color: var(--text-secondary);
}

/* Code Elements */
.theme-dark code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.theme-dark pre {
    background: var(--code-bg);
    color: var(--text-primary);
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Code block header effect */
.theme-dark pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--info-color) 100%);
    border-radius: 8px 8px 0 0;
}

.theme-dark pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Text Emphasis */
.theme-dark strong,
.theme-dark b {
    color: var(--text-primary);
}

.theme-dark em,
.theme-dark i {
    color: var(--text-secondary);
}

.theme-dark mark {
    background: rgba(255, 193, 7, 0.3);
    color: var(--text-primary);
    padding: 2px 4px;
}

.theme-dark small {
    color: var(--text-muted);
}

.theme-dark del,
.theme-dark s {
    color: var(--text-muted);
}

.theme-dark ins,
.theme-dark u {
    color: var(--text-secondary);
}

/* Technical Elements */
.theme-dark kbd {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.theme-dark var {
    color: #e74c3c;
    font-style: italic;
}

.theme-dark samp {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    padding: 2px 6px;
    font-family: monospace;
}

/* Address */
.theme-dark address {
    color: var(--text-secondary);
    font-style: normal;
}

/* Abbreviations */
.theme-dark abbr[title] {
    color: var(--text-secondary);
    text-decoration: underline dotted;
    cursor: help;
}

/* =================================
   UI Components Dark Mode
   ================================= */

/* Alerts and Notifications */
.theme-dark .alert,
.theme-dark .notification {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark .alert-info,
.theme-dark .notification-info {
    background: rgba(64, 200, 224, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

.theme-dark .alert-success,
.theme-dark .notification-success {
    background: rgba(50, 215, 75, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.theme-dark .alert-warning,
.theme-dark .notification-warning {
    background: rgba(255, 159, 10, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.theme-dark .alert-danger,
.theme-dark .notification-danger,
.theme-dark .alert-error,
.theme-dark .notification-error {
    background: rgba(255, 69, 58, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Badges and Tags */
.theme-dark .badge,
.theme-dark .tag {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.theme-dark .badge-primary,
.theme-dark .tag-primary {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

/* Tooltips */
.theme-dark .tooltip {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Breadcrumbs */
.theme-dark .breadcrumb {
    background: var(--secondary-bg);
    color: var(--text-secondary);
}

.theme-dark .breadcrumb-item {
    color: var(--text-secondary);
}

.theme-dark .breadcrumb-item.active {
    color: var(--text-primary);
}

.theme-dark .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* Pagination */
.theme-dark .pagination {
    background: var(--secondary-bg);
}

.theme-dark .page-link {
    background: var(--secondary-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.theme-dark .page-link:hover {
    background: var(--tertiary-bg);
    color: var(--text-primary);
}

.theme-dark .page-item.active .page-link {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.theme-dark .page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--secondary-bg);
}

/* Tabs */
.theme-dark .tab,
.theme-dark .tabs {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
}

.theme-dark .tab-item,
.theme-dark .tab-link {
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
}

.theme-dark .tab-item:hover,
.theme-dark .tab-link:hover {
    color: var(--text-primary);
    background: var(--tertiary-bg);
}

.theme-dark .tab-item.active,
.theme-dark .tab-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-color);
}

.theme-dark .tab-content {
    background: var(--secondary-bg);
    color: var(--text-secondary);
}

/* Modals */
.theme-dark .modal {
    background: rgba(0, 0, 0, 0.8);
}

.theme-dark .modal-content {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.theme-dark .modal-header {
    background: var(--tertiary-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark .modal-footer {
    background: var(--tertiary-bg);
    border-top: 1px solid var(--border-color);
}

/* Dropdowns */
.theme-dark .dropdown-menu {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-dark .dropdown-item {
    color: var(--text-secondary);
}

.theme-dark .dropdown-item:hover {
    background: var(--tertiary-bg);
    color: var(--text-primary);
}

.theme-dark .dropdown-divider {
    border-top: 1px solid var(--border-color);
}

/* Details/Summary */
.theme-dark details {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px;
}

.theme-dark summary {
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 500;
}

.theme-dark summary:hover {
    color: var(--accent-color);
}

/* Dialog */
.theme-dark dialog {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
}

/* Figure */
.theme-dark figure {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    padding: 10px;
}

.theme-dark figcaption {
    color: var(--text-muted);
    font-style: italic;
}

/* Progress and Meter */
.theme-dark progress {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
}

.theme-dark progress::-webkit-progress-bar {
    background: var(--tertiary-bg);
}

.theme-dark progress::-webkit-progress-value {
    background: var(--accent-color);
}

.theme-dark meter {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
}

/* =================================
   Facilities Page Dark Mode
   ================================= */

/* Certifications Section */
.theme-dark .certifications {
    background: var(--primary-bg);
}

.theme-dark .certifications-grid {
    background: transparent;
}

.theme-dark .certification-item,
.theme-dark .cert-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark .cert-icon {
    background: linear-gradient(135deg, var(--success-color) 0%, #2d8f5f 100%);
    color: #ffffff;
}

.theme-dark .cert-name,
.theme-dark .cert-title {
    color: var(--text-primary);
}

.theme-dark .cert-description {
    color: var(--text-secondary);
}

/* Factory Locations */
.theme-dark .factory-locations,
.theme-dark .locations-grid {
    background: var(--primary-bg);
}

.theme-dark .location-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .factory-list {
    background: transparent;
}

.theme-dark .factory-item {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.theme-dark .factory-item:hover {
    border-color: var(--accent-color);
    background: var(--card-bg);
}

.theme-dark .factory-item h4 {
    color: var(--text-primary);
}

/* =================================
   Headquarters Page Dark Mode
   ================================= */

/* Company Overview Section */
.theme-dark .company-overview-section {
    background: var(--primary-bg);
}

.theme-dark .overview-grid {
    background: transparent;
}

.theme-dark .overview-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.theme-dark .overview-card::before {
    /* Preserve the top gradient line */
    opacity: 0.8;
}

.theme-dark .card-icon {
    color: var(--accent-color);
}

.theme-dark .overview-card h3 {
    color: var(--text-primary);
}

.theme-dark .overview-card p,
.theme-dark .overview-card ul li {
    color: var(--text-secondary);
}

/* Leadership Section */
.theme-dark .leadership-section {
    background: var(--section-alt-bg);
}

.theme-dark .leader-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .leader-info h3 {
    color: var(--text-primary);
}

.theme-dark .leader-info p {
    color: var(--text-secondary);
}

/* Organization Chart */
.theme-dark .organization-section {
    background: var(--primary-bg);
}

.theme-dark .org-chart {
    background: transparent;
}

.theme-dark .org-level {
    background: transparent;
}

.theme-dark .organization {
    background: var(--primary-bg);
}

.theme-dark .org-box {
    background: var(--card-bg);
    border: 3px solid transparent;
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
                linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%) border-box;
    color: var(--text-primary);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.theme-dark .org-box:hover {
    background: var(--tertiary-bg);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(110, 158, 255, 0.25);
}

.theme-dark .org-box h3,
.theme-dark .org-box h4 {
    color: var(--text-primary);
}

.theme-dark .org-box p {
    color: var(--text-secondary);
}

.theme-dark .org-box.ceo {
    background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
                linear-gradient(135deg, #FFD700 0%, #FFA500 100%) border-box;
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.theme-dark .org-box.manager {
    border-color: var(--info-color);
}

.theme-dark .org-icon {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    box-shadow: 0 10px 30px rgba(110, 158, 255, 0.3);
}

.theme-dark .org-box.ceo .org-icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.theme-dark .role-badge {
    background: rgba(110, 158, 255, 0.1);
    color: var(--accent-color);
}

.theme-dark .org-box.ceo .role-badge {
    background: rgba(255, 215, 0, 0.2);
    color: #FFA500;
}

.theme-dark .org-level:first-child::after {
    background: linear-gradient(180deg, var(--accent-color) 0%, rgba(110, 158, 255, 0.2) 100%);
}

.theme-dark .org-level:nth-child(2)::before {
    background: var(--accent-color);
}

.theme-dark .executive-list {
    background: transparent;
}

.theme-dark .executive-item {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark .executive-item h4 {
    color: var(--text-primary);
}

.theme-dark .executive-item p {
    color: var(--text-secondary);
}

/* =================================
   Contact Page Dark Mode
   ================================= */

/* Contact Form */
.theme-dark .contact-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.theme-dark .contact-form h3 {
    color: var(--text-primary);
}

.theme-dark .form-group label {
    color: var(--text-primary);
}

.theme-dark .form-group input,
.theme-dark .form-group textarea {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark .form-group input:focus,
.theme-dark .form-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(110, 158, 255, 0.2);
}

/* Factory Locations Grid - Refined Dark Mode */
.theme-dark .factory-locations-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .factory-section-title {
    color: var(--text-primary);
}

.theme-dark .factory-section-title::after {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.theme-dark .factory-locations-grid {
    background: transparent;
}

.theme-dark .factory-location-card {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.theme-dark .factory-location-card::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.theme-dark .factory-location-card:hover {
    border-color: #667eea;
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.2);
}

.theme-dark .factory-header {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.theme-dark .factory-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-dark .factory-header h4 {
    color: var(--text-primary);
}

.theme-dark .factory-details p,
.theme-dark .factory-name,
.theme-dark .factory-address {
    color: var(--text-secondary);
}

.theme-dark .factory-info li {
    color: var(--text-secondary);
}

.theme-dark .factory-info i {
    color: #667eea;
}

/* Map Button */
.theme-dark .map-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
}

.theme-dark .map-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}


/* Map Modal */
.theme-dark .map-modal {
    background: rgba(0, 0, 0, 0.8);
}

.theme-dark .map-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
}

.theme-dark .map-modal h3 {
    color: var(--text-primary);
}

.theme-dark .close-modal {
    color: var(--text-secondary);
}

.theme-dark .close-modal:hover {
    color: var(--text-primary);
}

/* =================================
   Component Specific Dark Styles
   ================================= */

/* =================================
   Hero Section Enhanced
   ================================= */
.theme-dark .hero {
    background: var(--primary-bg);
}

.theme-dark .hero-title {
    color: var(--text-primary);
}

.theme-dark .hero-subtitle {
    color: var(--text-secondary);
}

/* Hero Statistics - Enhanced Visibility */
.theme-dark .hero-stats {
    background: rgba(26, 31, 46, 0.8);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
}

.theme-dark .stat-item {
    color: var(--text-primary);
    position: relative;
    padding: 20px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.theme-dark .stat-item:hover {
    background: rgba(110, 158, 255, 0.1);
    transform: translateY(-3px);
}

/* Statistics Numbers - Bold and Vibrant Colors */
.theme-dark .stat-number {
    background: linear-gradient(135deg, #00d4ff 0%, #6e9eff 50%, #ff6b9d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(110, 158, 255, 0.5);
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

/* Alternative solid color fallback for better compatibility */
.theme-dark .stat-number::before {
    content: attr(data-number);
    position: absolute;
    top: 0;
    left: 0;
    color: #00d4ff;
    z-index: -1;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

/* Enhanced stat labels */
.theme-dark .stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

/* Add glowing effect on hover */
.theme-dark .stat-item:hover .stat-number {
    transform: scale(1.05);
    text-shadow: 0 0 40px rgba(110, 158, 255, 0.8);
}

/* Responsive adjustments for stats */
@media (max-width: 768px) {
    .theme-dark .stat-number {
        font-size: 2.8rem;
    }
}

@media (max-width: 576px) {
    .theme-dark .stat-number {
        font-size: 2.4rem;
    }
    
    .theme-dark .stat-label {
        font-size: 1rem;
    }
}

/* Key Features Section */
.theme-dark .key-features {
    background: var(--primary-bg);
}

.theme-dark .key-features .section-title {
    color: var(--text-primary);
}

.theme-dark .key-features .section-subtitle {
    color: var(--text-secondary);
}

/* Features Grid */
.theme-dark .features-grid .feature-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .feature-card h3 {
    color: var(--text-primary);
}

.theme-dark .feature-card p {
    color: var(--text-secondary);
}

.theme-dark .feature-icon {
    color: var(--accent-color);
}

/* About Section */
.theme-dark .about,
.theme-dark .about-page {
    background: var(--primary-bg);
}

.theme-dark .about h2,
.theme-dark .about-page h2 {
    color: var(--text-primary);
}

.theme-dark .about p,
.theme-dark .about-page p {
    color: var(--text-secondary);
}

/* Company Overview Section */
.theme-dark .company-overview {
    background: var(--secondary-bg);
}

.theme-dark .company-overview h3 {
    color: var(--text-primary);
}

.theme-dark .company-overview p {
    color: var(--text-secondary);
}

/* Philosophy Section */
.theme-dark .philosophy {
    background: var(--secondary-bg);
}

.theme-dark .philosophy h3 {
    color: var(--text-primary);
}

.theme-dark .philosophy-item {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .philosophy-item h4 {
    color: var(--text-primary);
}

.theme-dark .philosophy-item p {
    color: var(--text-secondary);
}

/* Timeline Section */
.theme-dark .timeline {
    background: var(--primary-bg);
}

.theme-dark .timeline-container::before {
    background: linear-gradient(180deg, var(--accent-color) 0%, rgba(110, 158, 255, 0.2) 100%);
}

.theme-dark .timeline-item {
    background: transparent;
}

.theme-dark .timeline-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow-color);
}

.theme-dark .timeline-content:hover {
    background: var(--tertiary-bg);
    box-shadow: 0 15px 50px rgba(110, 158, 255, 0.15);
}

.theme-dark .timeline-date {
    background: var(--card-bg);
    color: var(--accent-color);
    border: 3px solid var(--accent-color);
    box-shadow: 0 8px 30px rgba(110, 158, 255, 0.3);
}

.theme-dark .timeline-item::before {
    background: var(--accent-color);
    border: 6px solid var(--card-bg);
    box-shadow: 0 0 0 10px rgba(110, 158, 255, 0.1);
}

.theme-dark .timeline-content h3,
.theme-dark .timeline-content h4 {
    color: var(--text-primary);
}

.theme-dark .timeline-content p {
    color: var(--text-secondary);
}

.theme-dark .milestone-icon {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    box-shadow: 0 8px 25px rgba(110, 158, 255, 0.3);
}

.theme-dark .timeline-content::before {
    background: var(--accent-color);
}

/* Products Section */
.theme-dark .products {
    background: var(--secondary-bg);
}

.theme-dark .products h2,
.theme-dark .products h3 {
    color: var(--text-primary);
}

.theme-dark .products p {
    color: var(--text-secondary);
}

/* Facilities Section */
.theme-dark .facilities,
.theme-dark .facilities-overview {
    background: var(--secondary-bg);
}

.theme-dark .facility-item {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .facility-content h3 {
    color: var(--text-primary);
}

.theme-dark .facility-content p {
    color: var(--text-secondary);
}

/* Factory Sections */
.theme-dark .factory-locations,
.theme-dark .factory-locations-section {
    background: var(--secondary-bg);
}

.theme-dark .factory-location-card,
.theme-dark .factory-item {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
}

.theme-dark .factory-section-title {
    color: var(--text-primary);
}

.theme-dark .factory-item h4 {
    color: var(--text-primary);
}

.theme-dark .factory-item p,
.theme-dark .factory-item ul li {
    color: var(--text-secondary);
}

/* Trusted Partners Section */
.theme-dark .trusted-partners {
    background: var(--section-alt-bg);
}

.theme-dark .partner-logo {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.theme-dark .partner-logo:hover {
    background: var(--tertiary-bg);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(110, 158, 255, 0.15);
}

.theme-dark .partner-logo img {
    filter: brightness(0.8) contrast(1.2);
}

.theme-dark .partner-logo:hover img {
    filter: brightness(1) contrast(1);
}

/* Customers Section */
.theme-dark .customers {
    background: var(--primary-bg);
}

.theme-dark .customer-logo {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
}

/* Language Switcher */
.theme-dark .language-switcher .language-btn {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark .language-dropdown,
.theme-dark .language-menu {
    background: rgba(26, 31, 46, 0.98);
    border: 1px solid rgba(110, 158, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.theme-dark .language-option {
    color: rgba(232, 234, 237, 0.9);
    background: transparent;
    border-bottom-color: rgba(47, 53, 65, 0.5);
}

.theme-dark .language-option:hover {
    background: rgba(110, 158, 255, 0.15);
    color: var(--text-primary);
}

.theme-dark .language-option.active {
    background: rgba(110, 158, 255, 0.2);
    color: var(--text-primary);
    font-weight: 600;
}

/* Mobile Language Options in Dark Mode */
.theme-dark .mobile-language-options {
    border-top-color: var(--border-color);
}

.theme-dark .mobile-language-title {
    color: var(--text-primary);
}

.theme-dark .mobile-language-option {
    color: var(--text-secondary);
}

.theme-dark .mobile-language-option:hover {
    background: rgba(110, 158, 255, 0.1);
    color: var(--text-primary);
}

.theme-dark .mobile-language-option.active {
    background: rgba(110, 158, 255, 0.15);
    color: var(--text-primary);
    font-weight: 500;
}

/* Tables */
.theme-dark table {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
}

.theme-dark th {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.theme-dark td {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.theme-dark tr:hover {
    background: var(--tertiary-bg);
}

/* =================================
   Responsive Dark Mode
   ================================= */
@media (max-width: 768px) {
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-right: 8px;
    }
}

/* =================================
   Beautiful Dark Theme Gradients
   ================================= */
.theme-dark {
    /* Subtle gradient overlay for depth */
    position: relative;
}

.theme-dark body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top, rgba(106, 158, 255, 0.05) 0%, transparent 60%),
                radial-gradient(ellipse at bottom, rgba(74, 111, 165, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* =================================
   Critical Dark Mode Overrides
   ================================= */

/* Override ALL white backgrounds */
.theme-dark *[style*="background: white"],
.theme-dark *[style*="background-color: white"],
.theme-dark *[style*="background:#fff"],
.theme-dark *[style*="background-color:#fff"],
.theme-dark *[style*="background: #fff"],
.theme-dark *[style*="background-color: #fff"],
.theme-dark *[style*="background:#ffffff"],
.theme-dark *[style*="background-color:#ffffff"],
.theme-dark *[style*="background: #ffffff"],
.theme-dark *[style*="background-color: #ffffff"] {
    background-color: var(--secondary-bg) !important;
}

/* Override CSS variables in dark mode */
.theme-dark {
    --white: var(--card-bg) !important;
    --background-light: var(--secondary-bg) !important;
    --text-dark: var(--text-primary) !important;
    --text-light: var(--text-secondary) !important;
    --primary-color: var(--accent-color) !important;
}

/* Force all sections to have dark backgrounds */
.theme-dark section {
    background-color: var(--primary-bg) !important;
    color: var(--text-secondary) !important;
}

/* Ensure hero section padding consistency in dark mode */
.theme-dark .hero {
    padding: 120px 0 80px 0 !important;
}

.theme-dark .index-hero {
    padding: 200px 0 120px !important;
}

/* Alternate section backgrounds for visual separation */
.theme-dark section:nth-of-type(even) {
    background-color: var(--section-alt-bg) !important;
}

/* Override style.css white/light backgrounds */
.theme-dark .company-overview,
.theme-dark .products,
.theme-dark .facilities,
.theme-dark .facilities-overview,
.theme-dark .factory-locations,
.theme-dark .contact-form,
.theme-dark .factory-location-card,
.theme-dark .factory-item,
.theme-dark .gallery-item,
.theme-dark .org-box,
.theme-dark .philosophy-item,
.theme-dark .customer-logo,
.theme-dark .equipment-item,
.theme-dark .feature-card,
.theme-dark .facility-item {
    background-color: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

/* Ensure ALL headings are visible */
.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6,
.theme-dark .section-title,
.theme-dark .section-header h2,
.theme-dark .section-header h3 {
    color: var(--text-primary) !important;
}

/* Ensure ALL paragraphs and text are visible */
.theme-dark p,
.theme-dark span,
.theme-dark li,
.theme-dark .section-subtitle {
    color: var(--text-secondary) !important;
}

/* Fix specific problem sections */
.theme-dark .key-features {
    background-color: var(--primary-bg) !important;
}

.theme-dark .philosophy {
    background-color: var(--section-alt-bg) !important;
}

.theme-dark .about,
.theme-dark .about-section {
    background-color: var(--primary-bg) !important;
}

/* Background light/white overrides */
.theme-dark .bg-light,
.theme-dark .bg-white,
.theme-dark [class*="bg-light"],
.theme-dark [class*="bg-white"] {
    background-color: var(--secondary-bg) !important;
}

/* =================================
   Universal Text Visibility Fix
   ================================= */

/* Force ALL text elements to be visible */
.theme-dark {
    color: var(--text-secondary) !important;
}

.theme-dark *:not([class*="icon"]):not(i):not(.fa):not([class*="fa-"]) {
    color: inherit;
}

/* Comprehensive heading visibility */
.theme-dark h1, .theme-dark h2, .theme-dark h3, 
.theme-dark h4, .theme-dark h5, .theme-dark h6,
.theme-dark .title, .theme-dark .heading,
.theme-dark [class*="title"], .theme-dark [class*="heading"] {
    color: var(--text-primary) !important;
}

/* Comprehensive paragraph and text visibility */
.theme-dark p, .theme-dark span, .theme-dark div,
.theme-dark li, .theme-dark td, .theme-dark th,
.theme-dark .text, .theme-dark [class*="text"],
.theme-dark .description, .theme-dark [class*="desc"] {
    color: var(--text-secondary) !important;
}

/* Special emphasis text */
.theme-dark .highlight, .theme-dark .accent,
.theme-dark [class*="highlight"], .theme-dark [class*="accent"] {
    color: var(--accent-color) !important;
}

/* =================================
   All Possible White Background Elements
   ================================= */

.theme-dark .white-bg,
.theme-dark .bg-white,
.theme-dark .background-white,
.theme-dark [style*="background: white"],
.theme-dark [style*="background-color: white"],
.theme-dark [style*="background:#ffffff"],
.theme-dark [style*="background-color:#ffffff"],
.theme-dark [style*="background: #ffffff"],
.theme-dark [style*="background-color: #ffffff"],
.theme-dark [style*="background:#fff"],
.theme-dark [style*="background-color:#fff"],
.theme-dark [style*="background: #fff"],
.theme-dark [style*="background-color: #fff"] {
    background-color: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

/* Additional selectors for common patterns */
.theme-dark .content-box,
.theme-dark .info-box,
.theme-dark .detail-box,
.theme-dark .spec-box,
.theme-dark .feature-box,
.theme-dark .service-box,
.theme-dark .product-box {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
}

/* Equipment Section */
.theme-dark .equipment-section,
.theme-dark .equipment {
    background: var(--primary-bg);
}

.theme-dark .equipment-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.theme-dark .equipment-item h3,
.theme-dark .equipment-item h4 {
    color: var(--text-primary);
}

.theme-dark .equipment-item p {
    color: var(--text-secondary);
}

/* =================================
   Business Page Dark Mode
   ================================= */

/* Business Areas Section */
.theme-dark .business-areas {
    background: var(--primary-bg) !important;
}

.theme-dark .business-grid {
    background: transparent;
}

.theme-dark .business-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
    color: var(--text-secondary);
}

.theme-dark .business-item:hover {
    background: var(--tertiary-bg) !important;
    border-color: var(--accent-color);
    box-shadow: 0 12px 40px rgba(110, 158, 255, 0.2);
}

.theme-dark .business-item h3 {
    color: var(--text-primary) !important;
}

.theme-dark .business-item p {
    color: var(--text-secondary) !important;
}

.theme-dark .business-icon {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: #ffffff;
}

/* Products Section */
.theme-dark .products {
    background: var(--section-alt-bg) !important;
}

.theme-dark .product-categories {
    background: transparent;
}

.theme-dark .product-category {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
}

.theme-dark .product-category:hover {
    background: var(--tertiary-bg) !important;
    border-color: var(--accent-color);
    transform: translateY(-8px);
}

.theme-dark .product-category h3 {
    color: var(--text-primary) !important;
}

.theme-dark .product-category p,
.theme-dark .product-category ul li {
    color: var(--text-secondary) !important;
}

.theme-dark .category-icon {
    background: linear-gradient(135deg, var(--info-color) 0%, var(--accent-color) 100%);
    color: #ffffff;
}

/* Manufacturing Process Section */
.theme-dark .process {
    background: var(--primary-bg) !important;
}

.theme-dark .process-steps {
    background: transparent;
}

.theme-dark .process-step {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
    color: var(--text-secondary);
}

.theme-dark .process-step:hover {
    background: var(--tertiary-bg) !important;
    border-color: var(--success-color);
    transform: translateY(-5px);
}

.theme-dark .process-step h4 {
    color: var(--text-primary) !important;
}

.theme-dark .process-step p {
    color: var(--text-secondary) !important;
}

.theme-dark .step-number {
    background: linear-gradient(135deg, var(--success-color) 0%, #2d8f5f 100%);
    color: #ffffff;
    border: 2px solid var(--success-color);
}

/* Process Connection Line */
.theme-dark .process-steps::before {
    background: linear-gradient(90deg, var(--border-color) 0%, var(--accent-color) 50%, var(--border-color) 100%);
}

/* Clients Section */
.theme-dark .clients {
    background: var(--section-alt-bg) !important;
}

.theme-dark .clients-grid {
    background: transparent;
}

.theme-dark .client-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.theme-dark .client-item:hover {
    background: var(--tertiary-bg) !important;
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

.theme-dark .client-logo {
    filter: brightness(0.8) contrast(1.2);
}

.theme-dark .client-item h4 {
    color: var(--text-primary) !important;
}

/* Business Specific Icons and Decorations */
.theme-dark .business-item::before,
.theme-dark .product-category::before,
.theme-dark .process-step::before {
    background: linear-gradient(135deg, rgba(110, 158, 255, 0.1) 0%, rgba(88, 196, 220, 0.1) 100%);
}

/* Business Theme Colors for Dark Mode */
.theme-dark .business-item.home-appliances .business-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-dark .business-item.automotive .business-icon {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
}

.theme-dark .business-item.electronics .business-icon {
    background: linear-gradient(135deg, #FF6B35 0%, #F45432 100%);
}

.theme-dark .business-item.quality-control .business-icon {
    background: linear-gradient(135deg, var(--success-color) 0%, #2d8f5f 100%);
}

/* Enhanced Typography for Business Page */
.theme-dark .business-areas h2,
.theme-dark .products h2,
.theme-dark .process h2,
.theme-dark .clients h2 {
    color: var(--text-primary) !important;
}

.theme-dark .section-subtitle {
    color: var(--text-secondary) !important;
}

/* Special Lists and Content */
.theme-dark .feature-list li,
.theme-dark .specification-list li,
.theme-dark .process-list li {
    color: var(--text-secondary) !important;
}

.theme-dark .feature-list li::before,
.theme-dark .specification-list li::before {
    color: var(--accent-color) !important;
}

/* Business Cards Enhanced Effects */
.theme-dark .business-item,
.theme-dark .product-category,
.theme-dark .process-step {
    position: relative;
    overflow: hidden;
}

.theme-dark .business-item::after,
.theme-dark .product-category::after,
.theme-dark .process-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(110, 158, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.theme-dark .business-item:hover::after,
.theme-dark .product-category:hover::after,
.theme-dark .process-step:hover::after {
    left: 100%;
}

/* =================================
   Business Page Responsive Dark Mode
   ================================= */

@media (max-width: 768px) {
    .theme-dark .business-grid,
    .theme-dark .product-categories,
    .theme-dark .process-steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theme-dark .business-item,
    .theme-dark .product-category,
    .theme-dark .process-step {
        padding: 30px 20px;
    }
}

@media (max-width: 576px) {
    .theme-dark .business-item,
    .theme-dark .product-category,
    .theme-dark .process-step {
        padding: 25px 15px;
    }
    
    .theme-dark .business-icon,
    .theme-dark .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* =================================
   Final Catch-All Rules
   ================================= */

/* Business Page Specific Overrides */
.theme-dark [class*="business"],
.theme-dark [class*="product"],
.theme-dark [class*="process"],
.theme-dark [class*="client"] {
    background-color: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

/* Any remaining white or light backgrounds */
.theme-dark [class*="white"],
.theme-dark [class*="light"],
.theme-dark [id*="white"],
.theme-dark [id*="light"] {
    background-color: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

/* Force business page gradients to dark */
.theme-dark [style*="linear-gradient"][style*="#f8f9fa"],
.theme-dark [style*="linear-gradient"][style*="#ffffff"] {
    background: var(--card-bg) !important;
}

/* Ensure buttons are always visible */
.theme-dark button,
.theme-dark input[type="button"],
.theme-dark input[type="submit"] {
    color: var(--text-primary) !important;
    background-color: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
}

/* Ensure links are always visible */
.theme-dark a:not([class*="btn"]) {
    color: var(--link-color) !important;
}

/* Ensure all containers have proper backgrounds */
.theme-dark .container,
.theme-dark .wrapper,
.theme-dark .content,
.theme-dark main,
.theme-dark article {
    background-color: transparent !important;
}

/* Last resort for absolutely positioned or fixed elements */
.theme-dark [style*="position: absolute"],
.theme-dark [style*="position: fixed"] {
    background-color: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

/* Gallery Section */
.theme-dark .gallery-section {
    background: var(--secondary-bg);
}

.theme-dark .gallery-item {
    background: var(--tertiary-bg);
    border: 1px solid var(--border-color);
}

/* Organization Section */
.theme-dark .organization {
    background: var(--primary-bg);
}

.theme-dark .org-box {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* =================================
   Smooth Theme Transition
   ================================= */
/* Apply transition only when theme is changing */
html.theme-transition,
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
    transition: background-color 0.3s ease !important, 
                color 0.3s ease !important, 
                border-color 0.3s ease !important,
                box-shadow 0.3s ease !important;
}

/* Prevent flash on initial load */
@media (prefers-color-scheme: dark) {
    /* Use system dark mode as initial state */
    :root {
        --primary-bg: #0f1419;
        --secondary-bg: #1a1f2e;
        --tertiary-bg: #232937;
        --text-primary: #e8eaed;
        --text-secondary: #9aa0a6;
        --text-muted: #70757a;
        --border-color: #2f3541;
        --shadow-color: rgba(0, 0, 0, 0.5);
        --accent-color: #6e9eff;
        --accent-hover: #5a8fee;
        --card-bg: #1a1f2e;
        --section-alt-bg: #141922;
    }
}

/* =================================
   Print Styles (Dark Mode)
   ================================= */
@media print {
    .theme-dark,
    .theme-dark * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border-color: #cccccc !important;
    }
    
    .theme-toggle {
        display: none !important;
    }
    
    /* Ensure printed content is readable */
    .theme-dark h1, .theme-dark h2, .theme-dark h3,
    .theme-dark h4, .theme-dark h5, .theme-dark h6 {
        color: #000000 !important;
    }
    
    .theme-dark p, .theme-dark li, .theme-dark span {
        color: #333333 !important;
    }
}

/* =================================
   High Contrast Mode Support
   ================================= */
@media (prefers-contrast: high) {
    .theme-dark {
        --primary-bg: #000000;
        --secondary-bg: #1a1a1a;
        --text-primary: #ffffff;
        --border-color: #666666;
    }
}

/* =================================
   Language-Specific Overrides
   ================================= */

/* Common patterns across all language pages */
.theme-dark [lang="en"],
.theme-dark [lang="ko"],
.theme-dark [lang="ja"],
.theme-dark [lang="th"],
.theme-dark [lang="zh"] {
    color: var(--text-secondary) !important;
}

/* Ensure multilingual content is visible */
.theme-dark .lang-content,
.theme-dark .language-content,
.theme-dark [class*="lang-"],
.theme-dark [class*="language-"] {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
}

/* =================================
   Fix for Text Highlight Background in Dark Mode
   ================================= */

/* Remove text highlight backgrounds (like Word's text highlighting) in dark mode */
.theme-dark span[style*="background"],
.theme-dark [style*="background-color"] {
    background: transparent !important;
    background-color: transparent !important;
}

/* =================================
   Headquarters Page Dark Mode Styles
   ================================= */

/* Headquarters Hero Section */
.theme-dark .headquarters-hero {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(35, 41, 55, 0.9) 100%);
}

/* Company Overview Section */
.theme-dark .company-overview-section {
    background: linear-gradient(to bottom, var(--primary-bg) 0%, var(--secondary-bg) 50%, var(--primary-bg) 100%);
}

.theme-dark .company-overview-section::before {
    background: url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%236e9eff" fill-opacity="0.03"%3E%3Cpath d="M50 50c0-13.807 11.193-25 25-25s25 11.193 25 25-11.193 25-25 25-25-11.193-25-25zm25-10c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

/* Headquarters Info Section */
.theme-dark .headquarters-info {
    background: var(--secondary-bg);
}

/* Organization Section */
.theme-dark .organization-section {
    background: var(--primary-bg);
}

/* Gallery Section */
.theme-dark .gallery-section {
    background: var(--secondary-bg);
}

/* Location Section */
.theme-dark .location-section {
    background: var(--primary-bg);
}

/* =================================
   Debugging and Development
   ================================= */

/* Temporary debugging outline (remove in production) */
/*
.theme-dark * {
    outline: 1px solid rgba(255, 0, 0, 0.1) !important;
}
*/

/* =================================
   Reduced Motion Support
   ================================= */
@media (prefers-reduced-motion: reduce) {
    .theme-dark,
    .theme-dark *,
    .theme-toggle,
    .theme-toggle i {
        transition: none;
        animation: none;
    }
}

/* =================================
   About Page Dark Mode Styles
   ================================= */

/* Company Info 카드 다크모드 스타일 */
[data-theme="dark"] .company-info,
[data-theme="dark"] .info-grid {
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
}

[data-theme="dark"] .info-item {
    background: #16213e;
    color: #e0e0e0;
    border: 1px solid #0f3460;
}

[data-theme="dark"] .info-item strong {
    color: #ffffff;
}

[data-theme="dark"] .info-item span {
    color: #b0b0b0;
}

[data-theme="dark"] .info-item i {
    color: #4a6fa5;
}

/* 다크모드 호버 효과 */
[data-theme="dark"] .info-item:hover {
    background: #1e3a5f;
    border-color: #4a6fa5;
    transform: translateY(-2px);
}

/* Philosophy 카드 다크모드 */
[data-theme="dark"] .philosophy-item {
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
}

[data-theme="dark"] .philosophy-item:hover {
    background: #16213e;
    border-color: #4a6fa5;
}

/* Timeline 카드 다크모드 */
[data-theme="dark"] .timeline-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
}

[data-theme="dark"] .timeline-content {
    background: #16213e;
}

/* Organization 카드 다크모드 */
[data-theme="dark"] .org-card {
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    color: #e0e0e0;
}

[data-theme="dark"] .org-card:hover {
    border-color: #4a6fa5;
    box-shadow: 0 4px 20px rgba(74, 111, 165, 0.3);
}