/* ==========================================================================
   RoxyMaz Tools - Light / Dark Mode Theme System
   ========================================================================== */

/* 1. Theme Toggle Button Component */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: #fbbf24;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    user-select: none;
    outline: none;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

/* Default (Dark Mode): Show Sun icon, Hide Moon icon */
html[data-theme="dark"] .theme-icon-sun,
html:not([data-theme="light"]) .theme-icon-sun {
    display: inline-block !important;
}

html[data-theme="dark"] .theme-icon-moon,
html:not([data-theme="light"]) .theme-icon-moon {
    display: none !important;
}

/* Light Mode: Show Moon icon, Hide Sun icon */
html[data-theme="light"] .theme-icon-sun {
    display: none !important;
}

html[data-theme="light"] .theme-icon-moon {
    display: inline-block !important;
    color: #4f46e5;
}

html[data-theme="light"] .theme-toggle-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #4f46e5;
}

html[data-theme="light"] .theme-toggle-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Smooth color transitions when theme changes */
body, .navbar, .card, .tool-card, .stat-card, .card-details, .section-card,
.domain-header-card, .search-box-card, .quick-lookup-box, .footer,
.info-table-wrap, .ua-box, .resolver-card, .query-result-card,
.quick-input, .domain-input, .form-control, .form-select, #domain-input {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease !important;
}

/* 2. Light Mode Overrides */
html[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-2: #f1f5f9;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: rgba(99, 102, 241, 0.4);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
}

html[data-theme="light"] body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

/* Ambient FX in light mode */
html[data-theme="light"] .ambient-bg {
    opacity: 0.22 !important;
}

html[data-theme="light"] .grid-pattern {
    background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px) !important;
}

/* Navbar */
html[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .nav-btn {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html[data-theme="light"] .nav-btn:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .live-status-pill {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: #059669 !important;
}

/* Headings & Text */
html[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #0f172a 30%, #334155 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

html[data-theme="light"] .hero-badge {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

html[data-theme="light"] .visitor-bar {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
    color: #475569 !important;
}

html[data-theme="light"] .visitor-highlight {
    color: #0f172a !important;
}

/* Cards & Containers */
html[data-theme="light"] .tool-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .tool-card:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .card-title {
    color: #0f172a !important;
}

html[data-theme="light"] .tag {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html[data-theme="light"] .feature-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .feature-item h4 {
    color: #0f172a !important;
}

/* Quick Domain Lookup Box */
html[data-theme="light"] .quick-lookup-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .quick-lookup-text h3 {
    color: #0f172a !important;
}

html[data-theme="light"] .quick-lookup-text p {
    color: #475569 !important;
}

/* Search Box Cards & Inputs */
html[data-theme="light"] .search-box-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .quick-input,
html[data-theme="light"] .domain-input,
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] #domain-input {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .quick-input::placeholder,
html[data-theme="light"] .domain-input::placeholder,
html[data-theme="light"] .form-control::placeholder,
html[data-theme="light"] #domain-input::placeholder {
    color: #94a3b8 !important;
}

html[data-theme="light"] .quick-input:focus,
html[data-theme="light"] .domain-input:focus,
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus,
html[data-theme="light"] #domain-input:focus {
    background: #ffffff !important;
    border-color: #6366f1 !important;
}

/* Example Chips */
html[data-theme="light"] .example-chip {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html[data-theme="light"] .example-chip:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* WHOIS Lookup */
html[data-theme="light"] .domain-header-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 6px 20px -5px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .domain-name-title {
    color: #0f172a !important;
}

html[data-theme="light"] .action-chip {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html[data-theme="light"] .action-chip:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .stat-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .stat-value {
    color: #0f172a !important;
}

html[data-theme="light"] .card-details {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .tabs-header {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] .tab-btn {
    color: #64748b !important;
}

html[data-theme="light"] .tab-btn:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

html[data-theme="light"] .tab-btn.active {
    color: #d97706 !important;
    background: #ffffff !important;
}

html[data-theme="light"] .info-item {
    border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] .info-value {
    color: #0f172a !important;
}

html[data-theme="light"] .status-badge-item,
html[data-theme="light"] .ns-badge-item {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .status-desc {
    color: #475569 !important;
}

html[data-theme="light"] .privacy-alert {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
}

html[data-theme="light"] .privacy-alert-text strong {
    color: #4338ca !important;
}

/* DNS Checker */
html[data-theme="light"] .domain-comparison-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .domain-col-name {
    color: #0f172a !important;
}

html[data-theme="light"] .section-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .section-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .section-title {
    color: #0f172a !important;
}

html[data-theme="light"] .dns-table th,
html[data-theme="light"] .info-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .dns-table td,
html[data-theme="light"] .info-table td {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .dns-table tr:hover td,
html[data-theme="light"] .info-table tr:hover td {
    background: #f8fafc !important;
}

html[data-theme="light"] .dns-table .mono,
html[data-theme="light"] .info-table .mono {
    color: #0f172a !important;
}

html[data-theme="light"] .www-banner.success {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

html[data-theme="light"] .www-banner.warning {
    background: #fffbeb !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

/* DiG DNS Lookup */
html[data-theme="light"] .resolver-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .resolver-card:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .resolver-card .resolver-name {
    color: #0f172a !important;
}

html[data-theme="light"] .resolver-card.active {
    background: #f0fdf4 !important;
    border-color: #10b981 !important;
}

html[data-theme="light"] .type-pill {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html[data-theme="light"] .type-pill:hover {
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .type-pill.active {
    background: #ede9fe !important;
    color: #6366f1 !important;
    border-color: #a78bfa !important;
}

html[data-theme="light"] .query-result-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .query-card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .card-title-text {
    color: #0f172a !important;
}

html[data-theme="light"] .option-checkbox-label {
    color: #475569 !important;
}

html[data-theme="light"] .view-tab-btn {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html[data-theme="light"] .view-tab-btn.active {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* SSL Tools */
html[data-theme="light"] .card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .form-label {
    color: #475569 !important;
}

html[data-theme="light"] .nav-tabs {
    border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] .nav-tabs .nav-link {
    background: #f8fafc !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .nav-tabs .nav-link:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .nav-tabs .nav-link.active {
    background: #ffffff !important;
    color: #0284c7 !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 2px 6px rgba(6, 182, 212, 0.15) !important;
}

html[data-theme="light"] .file-upload-area {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .file-upload-area:hover {
    background: #f0f9ff !important;
    border-color: #38bdf8 !important;
}

/* Cek Koneksi & Visitor Info */
html[data-theme="light"] .card-highlight {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-color: #10b981 !important;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.12) !important;
}

html[data-theme="light"] .ip-display {
    color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] .isp-row {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .isp-row strong {
    color: #0f172a !important;
}

html[data-theme="light"] .detail-value {
    color: #0f172a !important;
}

html[data-theme="light"] .info-table-wrap {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .ua-box {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .ua-box code {
    color: #0f172a !important;
}

html[data-theme="light"] .btn-copy {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

html[data-theme="light"] .btn-copy:hover {
    background: #f1f5f9 !important;
    border-color: #10b981 !important;
    color: #059669 !important;
}

/* Footer */
html[data-theme="light"] .footer {
    background: #ffffff !important;
    border-top-color: #e2e8f0 !important;
}

html[data-theme="light"] .footer-brand span,
html[data-theme="light"] .footer-links a {
    color: #64748b !important;
}

html[data-theme="light"] .footer-links a:hover {
    color: #0f172a !important;
}
