/* Public Pages Common Styles */

/* Theme colors come from theme_variables.php (single source of truth).
   Only structural defaults that theme_variables doesn't emit live here. */
:root {
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --border-radius: 12px;
}

/* Dark mode: variables come from public_header.php (Theme Colors) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--page-bg);
    overflow-x: hidden;
}

/* Make dark/light switch visually obvious (hero overlays) */
.page-hero,
.hero,
.about-hero {
    position: relative;
}

.page-hero > .container,
.about-hero > .container,
.hero .hero-content {
    position: relative;
    z-index: 1;
}

[data-bs-theme="dark"] .page-hero::after,
[data-bs-theme="dark"] .hero::after,
[data-bs-theme="dark"] .about-hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.35) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Navigation - use !important to override Bootstrap and ensure Theme Colors apply */
.navbar {
    background: var(--nav-bg) !important;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    border-bottom: 1px solid var(--nav-border) !important;
    backdrop-filter: blur(12px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nav-brand, var(--primary-color)) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--nav-brand, var(--primary-color)) !important;
}

.navbar-nav .nav-link {
    color: var(--nav-link, var(--text-dark));
    font-weight: 500;
    margin: 0 0.5rem;
    transition: color 0.3s;
    text-decoration: none;
}

.nav-actions .nav-link {
    margin: 0;
}

.navbar-nav .nav-link:hover {
    color: var(--nav-link-hover, var(--primary-color));
}

.navbar-nav .nav-link.active {
    color: var(--nav-link-active, var(--primary-color));
    font-weight: 600;
}

/* Theme toggle */
.btn-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-1);
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary-color), transparent 70%);
}

[data-bs-theme="dark"] .btn-theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-bs-theme="dark"] .navbar .navbar-toggler-icon {
    filter: invert(1);
}

/* User Dropdown */
.user-profile-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.2s ease;
    background: transparent;
}

.user-profile-box:hover {
    background: var(--bg-light);
    text-decoration: none;
    color: var(--text-dark);
}

.user-profile-box .user-avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--nav-border);
    transition: border-color 0.2s;
}

.user-profile-box:hover .user-avatar-container {
    border-color: var(--primary-color);
}

.user-profile-box .user-avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-box .user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-profile-box .user-name {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.user-profile-box .dropdown-toggle::after {
    margin-left: 0.5rem;
    opacity: 0.6;
}

.navbar-nav .dropdown-toggle {
    cursor: pointer;
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    min-width: 200px;
}

[data-bs-theme="dark"] .navbar-nav .dropdown-menu {
    background: var(--surface-1);
    border: 1px solid rgba(255,255,255,0.08);
}

.navbar-nav .dropdown-item {
    padding: 0.75rem 1.5rem;
    color: var(--text-dark);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.navbar-nav .dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

[data-bs-theme="dark"] .navbar-nav .dropdown-item:hover {
    background: rgba(255,255,255,0.06);
}

.navbar-nav .dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.btn-primary-custom {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-outline-custom:hover {
    background: var(--primary-color);
    color: white;
}

/* Make Bootstrap primary buttons match site theme */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Footer - colors from Theme Colors (footer_bg, footer_text, footer_link) */
.footer {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px circle at 10% -20%, rgba(var(--primary-rgb, 26, 187, 156), 0.22) 0%, transparent 55%),
        radial-gradient(900px circle at 110% 0%, rgba(var(--primary-rgb, 26, 187, 156), 0.16) 0%, transparent 55%),
        linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.45) 100%),
        var(--footer-bg);
    color: var(--footer-text);
    padding: 4.25rem 0 2.25rem;
    margin-top: 80px;
}

.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0.95;
}

.footer .container {
    position: relative;
    z-index: 1;
}

.footer p {
    margin: 0;
    opacity: 0.9;
    color: var(--footer-text) !important;
}

.footer-widgets {
    padding-bottom: 1rem;
}

.footer-widget-title {
    font-weight: 800;
    margin-bottom: 0.85rem;
    letter-spacing: -0.3px;
    display: inline-block;
    position: relative;
    color: var(--footer-text) !important;
}

.footer-widget-title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 99px;
}

.footer-widget-content {
    opacity: 0.96;
    font-size: 0.98rem;
    line-height: 1.8;
}

.footer-widget-content p {
    margin: 0 0 0.85rem 0;
}

.footer-widget-content a {
    color: var(--footer-link) !important;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.footer-widget-content a:hover {
    color: var(--footer-link-hover) !important;
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin: 0.45rem 0;
}

.footer-sep {
    border-color: rgba(255, 255, 255, 0.12);
    margin: 1.75rem 0 1.25rem;
}

.footer-bottom {
    padding-top: 0.5rem;
}

/* Dark-mode helpers for common public page cards */
[data-bs-theme="dark"] .tab-card,
[data-bs-theme="dark"] .model-card,
[data-bs-theme="dark"] .feature-card,
[data-bs-theme="dark"] .timeline-content,
[data-bs-theme="dark"] .reseller-card,
[data-bs-theme="dark"] .login-card,
[data-bs-theme="dark"] .card {
    background: var(--surface-1) !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

[data-bs-theme="dark"] .contact-detail-item {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .contact-detail-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .timeline-item:nth-child(odd) .timeline-content::after {
    border-left-color: var(--surface-1) !important;
}

[data-bs-theme="dark"] .timeline-item:nth-child(even) .timeline-content::after {
    border-right-color: var(--surface-1) !important;
}

[data-bs-theme="dark"] .timeline-dot {
    background: var(--surface-2) !important;
    box-shadow: 0 0 0 6px var(--surface-2), 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}

[data-bs-theme="dark"] .feature-modal-content {
    background: var(--surface-1) !important;
    color: var(--text-dark) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
}

[data-bs-theme="dark"] .trusted-by-item,
[data-bs-theme="dark"] .reseller-card-home {
    background: var(--surface-1) !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.10) !important;
}

[data-bs-theme="dark"] .trusted-by-item img {
    background: rgba(255,255,255,0.06) !important;
}

[data-bs-theme="dark"] .trusted-by-slider::before {
    background: linear-gradient(to right, var(--page-bg), rgba(0,0,0,0)) !important;
}

[data-bs-theme="dark"] .trusted-by-slider::after {
    background: linear-gradient(to left, var(--page-bg), rgba(0,0,0,0)) !important;
}

[data-bs-theme="dark"] .requirements-section {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

[data-bs-theme="dark"] .requirement-item {
    background: var(--surface-1) !important;
    border-color: rgba(255,255,255,0.10) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .btn-primary-custom {
        margin-top: 0.5rem;
    }
    
    .user-profile-box {
        padding: 0.4rem 0.5rem;
    }
    
    .user-profile-box .user-avatar-container {
        width: 36px;
        height: 36px;
    }
}

