/* ============================================
   iFieldSmart AI Blog - Common Styles
   Professional, Advanced, Fully Responsive
   ============================================ */

/* CSS Variables */
:root {
    --primary: #e36f1d;
    --primary-rgb: 227, 111, 29;
    --primary-dark: #c25e16;
    --primary-light: #ff8534;
    --secondary: #583e3a;
    --text-dark: #0f172a;
    --text-medium: #334155;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --bg-white: #ffffff;
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-white);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
    margin-bottom: 1rem;
    color: var(--text-medium);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
}

/* Header Styles - Same as Home Page */
header {
    position: fixed;
    top: 0;
    left: 0;
    padding: 12px 3vw;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo-container img {
    height: 40px;
    width: auto;
    display: block;
}

/* Navigation Styles */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu li a:hover {
    color: var(--primary);
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    width: 100%;
}

.nav-menu li a.active {
    color: var(--primary);
}

.login-btn,
.btn-primary {
    background: #ea6d13;
    color: white;
    border: none;
    padding: 12px 50px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(234, 109, 19, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(234, 109, 19, 0.35);
    color: white;
    filter: brightness(1.05);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
    display: block;
    position: absolute;
}

.hamburger span:nth-child(1) {
    top: 10px;
}

.hamburger span:nth-child(2) {
    top: 18px;
}

.hamburger span:nth-child(3) {
    top: 26px;
}

.hamburger.active span:nth-child(1) {
    top: 18px;
    transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    top: 18px;
    transform: rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 65px;
    left: 0;
    width: 100%;
    height: calc(100vh - 65px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    padding: 32px 20px;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-menu ul li a {
    display: block;
    padding: 16px 0;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 18px;
    border-bottom: 1px solid var(--border-color);
    transition: color var(--transition-base);
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a.active {
    color: var(--primary);
}

.mobile-menu .login-btn,
.mobile-menu .btn-primary {
    width: 100%;
    margin-top: 16px;
    display: inline-block !important;
    padding: 14px 32px !important;
    background: var(--primary) !important;
    color: white !important;
    border-radius: 100px !important;
    font-weight: 700 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(227, 111, 29, 0.3) !important;
}

.mobile-menu .login-btn:hover,
.mobile-menu .btn-primary:hover {
    background: #d65d0f !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(227, 111, 29, 0.4) !important;
    color: white !important;
}

/* Responsive - Show/Hide Navigation */
@media (max-width: 991px) {
    /* Show hamburger on mobile/tablet */
    .hamburger {
        display: flex !important;
    }
    
    /* Hide desktop navigation on mobile/tablet - More specific selectors */
    header nav,
    header .nav-menu,
    header .login-btn,
    .d-flex.align-items-center.gap-4 {
        display: none !important;
    }
    
    /* Ensure header layout works on mobile */
    header {
        justify-content: space-between !important;
    }
    
    /* Make sure logo and hamburger are visible */
    .logo-container {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    /* Hide hamburger on desktop */
    .hamburger {
        display: none !important;
    }
    
    /* Hide mobile menu on desktop */
    .mobile-menu {
        display: none !important;
    }
}

/* Footer */
.blog-footer {
    background: var(--text-dark);
    color: white;
    padding: 60px 0 30px;
    margin-top: 120px;
}

.footer-content {
    text-align: center;
}

.footer-logo {
    margin-bottom: 24px;
}

.footer-logo img {
    height: 40px;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.footer-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all var(--transition-base);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 998;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Responsive - Adjust position on mobile to avoid overlap with mini player */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 100px; /* Position above mini player */
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 90px; /* Position above mini player */
        right: 16px;
        width: 40px;
        height: 40px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(var(--primary-rgb), 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

/* Responsive Utilities */
@media (max-width: 991px) {
    .d-lg-none { display: none !important; }
    .d-lg-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .d-lg-block { display: block !important; }
}

/* Smooth Animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .blog-header,
    .mobile-menu,
    .back-to-top,
    .blog-footer {
        display: none !important;
    }
}

/* ============================================
   Waitlist Modal Styles
   ============================================ */

.modal-content-premium {
    border-radius: 24px;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 32px;
    background: #ffffff;
}

.modal-content-premium .modal-header {
    padding: 0;
    border: none;
    margin-bottom: 24px;
}

.modal-content-premium .modal-body {
    padding: 0;
}

.premium-input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
    background: #ffffff;
    color: var(--text-dark);
}

.premium-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(227, 111, 29, 0.1);
}

.premium-input::placeholder {
    color: #94a3b8;
}

/* International Telephone Input Styling */
.iti {
    width: 100%;
}

.iti__flag-container {
    border-radius: 12px 0 0 12px;
}

.iti__selected-flag {
    padding: 0 12px;
    border-radius: 12px 0 0 12px;
}

.iti__country-list {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 250px;
}

/* Modal Backdrop Blur */
.modal-backdrop.show {
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.5);
}
/* Force hide desktop navigation on mobile - High specificity */
@media (max-width: 991px) {
    body header nav.d-flex.align-items-center.gap-4,
    body header .nav-menu,
    body header .login-btn,
    body header nav {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Ensure hamburger is visible */
    body .hamburger {
        display: flex !important;
        visibility: visible !important;
    }
}
/* ============================================
   intlTelInput Dropdown Fix - Modal & Mobile
   ============================================ */

.modal-content-premium .iti {
    width: 100%;
}

/* Force dropdown to open UPWARD inside modal */
.modal .iti__dropdown-content {
    position: absolute !important;
    bottom: 100% !important;
    top: auto !important;
    left: 0 !important;
    max-height: 200px !important;
    border-radius: 12px !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15) !important;
    background: #fff !important;
    z-index: 99999 !important;
    margin-bottom: 4px;
}

.modal .iti__country-list {
    max-height: 180px !important;
}

/* Ensure parent allows overflow */
.modal-content-premium,
.modal-content-premium .modal-body,
.modal-content-premium .row,
.modal-content-premium .col-md-6 {
    overflow: visible !important;
}

.modal-dialog {
    overflow: visible !important;
}

.modal-content {
    overflow: visible !important;
}