/* ===================================================================
   CHAKULA SMART SYSTEM - MAIN STYLESHEET
   ===================================================================
   This stylesheet contains all styles for the Chakula Smart platform.
   Organized into logical sections for maintainability.
   
   Sections:
   1. Design Tokens (CSS Variables)
   2. Global Styles
   3. Layout Components (Hero, About, Features, etc.)
   4. Modal System (Signup, Login)
   5. Form Elements
   6. Buttons & Interactive Elements
   7. Typography
   8. Cards & Components
   9. Accessibility
   10. Responsive Design
   11. Performance Optimizations
   =================================================================== */

/* ================= Design Tokens ================= */
:root {
    /* Brand */
    --primary-green: #2d6a4f;
    --accent-orange: #ff9f1c;
    --deep-emerald: #1b4332;
    --soft-green: #e9f5db;
    --brand-900: #0d2818;
    --brand-800: #1b4332;
    --brand-700: #1a5c3a;
    --brand-600: #2d6a4f;
    --brand-500: #40916c;
    --accent-500: #d4a017;
    --accent-600: #b8860b;
    --accent-400: #e8b84a;
    --accent-light: #f4e4bc;
    /* Surfaces & text */
    --glass-white: rgba(255, 255, 255, 0.92);
    --surface-base: #f0f4f1;
    --surface-card: #ffffff;
    --surface-muted: #f6f9f7;
    --text-dark: #081c15;
    --text-primary: #0f1f17;
    --text-secondary: #5c6b63;
    --border-subtle: rgba(15, 31, 23, 0.08);
    --border-default: #d4ddd8;
    /* Typography */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    /* Elevation */
    --shadow-sm: 0 1px 3px rgba(15, 31, 23, 0.06);
    --shadow-card: 0 4px 20px rgba(15, 31, 23, 0.06), 0 1px 3px rgba(15, 31, 23, 0.04);
    --shadow-card-hover: 0 12px 32px rgba(15, 31, 23, 0.1), 0 4px 8px rgba(15, 31, 23, 0.04);
    --shadow-elevated: 0 20px 50px rgba(15, 31, 23, 0.12);
    --shadow-nav: 0 4px 24px rgba(13, 40, 24, 0.25);
    --shadow-3d: 0 20px 40px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-strong: 0 30px 60px rgba(0, 0, 0, 0.2), 0 10px 20px rgba(0, 0, 0, 0.1);
    --inner-glow: inset 0 0 15px rgba(255, 255, 255, 0.5);
    --focus-ring: 0 0 0 3px rgba(45, 106, 79, 0.2);
    /* Radius & motion */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================= Global ================= */
body {
    font-family: var(--font-body);
    background-color: #fdfdfd;
    background-image:
        radial-gradient(at 0% 0%, rgba(168, 230, 207, 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 159, 28, 0.08) 0, transparent 50%);
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.landing-page {
    perspective: 1000px;
}

/* Reset perspective for modals to prevent positioning issues */
body.modal-open {
    perspective: none !important;
}

/* ================= Advanced About Section (3D Layering) ================= */
.about {
    position: relative;
    padding: 120px 0;
    z-index: 1;
}

.about .container {
    background: var(--glass-white);
    padding: 4rem;
    border-radius: 40px;
    box-shadow: var(--shadow-3d);
    border: 1px solid rgba(255,255,255,0.6);
    transform: rotateY(-5deg) rotateX(2deg); /* Constant slight 3D angle */
    transition: transform 0.8s ease;
}

.about .container:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

.about ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
    margin-top: 40px;
}

.about ul li {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.05);
    border-bottom: 4px solid var(--primary-green);
    transform: translateZ(20px);
    transition: 0.3s;
}

.about ul li:hover {
    transform: translateZ(40px) translateY(-5px);
    background: var(--soft-green);
}

/* ================= 3D Feature Cards (Neon-Glow Border) ================= */
.features .card {
    height: 100%;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 1px solid rgba(45, 106, 79, 0.1);
    position: relative;
    overflow: hidden;
}

.features .card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, var(--primary-green), transparent, var(--accent-orange), transparent);
    animation: rotateGlow 6s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.features .card:hover::before {
    opacity: 0.3;
}

@keyframes rotateGlow {
    100% { transform: rotate(360deg); }
}

/* Modal backdrop styles consolidated below */

/* Modal fade animations consolidated below */

/* Modal title styles consolidated below */

/* ================= Form Fields (Enhanced) ================= */
.form-control {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
    color: var(--text-dark);
    width: 100%;
}

/* Smaller form controls for signup */
#signupModal .form-control {
    padding: 7px 11px;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:hover {
    border-color: var(--primary-green);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.12);
    transform: translateY(-1px);
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12), 0 4px 16px rgba(45, 106, 79, 0.18);
    transform: translateY(-1px) scale(1.01);
    outline: none;
}

/* Enhanced focus for signup form */
#signupModal .form-control:focus {
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15), 0 3px 12px rgba(45, 106, 79, 0.2) !important;
    border-width: 2.5px;
}

.form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.form-control:focus::placeholder {
    opacity: 0.6;
}

/* Enhanced placeholder for signup */
#signupModal .form-control::placeholder {
    font-size: 12px;
    opacity: 0.7;
}

/* ================= Interactive Footer (landing) ================= */
body.landing-page footer {
    background: var(--deep-emerald);
    color: #a8e6cf;
    padding: 60px 0 30px;
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0% 100%);
    margin-top: -30px;
}

body.landing-page footer a {
    color: var(--accent-orange);
    transition: 0.3s;
}

body.landing-page footer a:hover {
    color: white;
    text-shadow: 0 0 10px var(--accent-orange);
}

/* ================= Typography ================= */
.lead {
    font-weight: 500;
    color: var(--deep-emerald);
    opacity: 0.9;
}
/* ================= 3D Hero Section (Fixed) ================= */
header.hero {
    min-height: 95vh;
    background: linear-gradient(145deg, var(--brand-600) 0%, var(--brand-900) 55%, #0a1f14 100%);
    /* clip-path can sometimes clip modals if they are children; 
       Ensure modal HTML is at the bottom of index.php, not inside this header */
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: visible; /* Changed from hidden to allow modal to escape if nested */
    transform: translateZ(0); /* flattens stacking context */
    z-index: 1; /* Keep hero low */
}

header.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 200%;
    height: 200%;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
    animation: backgroundScroll 60s linear infinite;
    pointer-events: none;
    z-index: -1;
}

header.hero .container {
    position: relative;
    z-index: 10 !important;
    pointer-events: auto !important; 
}

/* ================= Modal Backdrop ================= */
.modal-backdrop {
    z-index: 1040 !important; 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.65), rgba(45, 106, 79, 0.55));
    pointer-events: auto !important;
    opacity: 1 !important;
    transition: backdrop-filter 0.3s ease, background 0.3s ease;
}

.modal-backdrop.show {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Enhanced backdrop for signup */
#signupModal + .modal-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Force Modal box to the absolute front */
.modal {
    z-index: 1050 !important;
    /* Reset perspective for the modal so it doesn't fly away */
    perspective: none !important;
    pointer-events: auto !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: none !important; /* Bootstrap will show it */
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
    -webkit-overflow-scrolling: touch !important; /* Smooth scrolling on mobile */
}

.modal.show {
    display: flex !important;
    opacity: 1 !important;
}

.modal-dialog {
    z-index: 1060 !important;
    /* This ensures the modal is not affected by the body's 3D perspective */
    transform: none !important;
    pointer-events: auto !important;
    position: relative !important;
    margin: 1.75rem auto !important;
    max-width: 450px !important;
    width: 90% !important;
    max-height: calc(100vh - 2rem) !important;
    display: flex !important;
    align-items: center !important;
}

/* Smaller signup modal - even more compact */
#signupModal .modal-dialog {
    max-width: 360px !important;
}

.modal-dialog-centered {
    align-items: center !important;
    min-height: calc(100% - 1rem) !important;
}

/* Bootstrap scrollable modal support */
.modal-dialog-scrollable {
    max-height: calc(100vh - 2rem) !important;
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 2rem) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Enhanced scrollable content for signup */
#signupModal.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 2rem) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 180px) !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* Enhanced scrollable for signup modal */
#signupModal.modal-dialog-scrollable .modal-body,
#signupModal .modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 130px) !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch !important;
    position: relative !important;
    height: auto !important;
}

/* ================= Modal Content ================= */
.modal-content {
    background: #ffffff !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05) !important;
    border: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
    max-height: calc(100vh - 2rem) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 20px !important;
    width: 100% !important;
    margin: 0 !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal-content * {
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Smaller border radius for signup with enhanced shadow */
#signupModal .modal-content {
    border-radius: 12px !important;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05), 0 0 0 0 rgba(45, 106, 79, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#signupModal.show .modal-content {
    box-shadow: 0 30px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05), 0 0 40px rgba(45, 106, 79, 0.15) !important;
}

/* Ensure all form elements are interactive */
.modal-content input,
.modal-content textarea,
.modal-content select,
.modal-content button {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Smooth scaling animation that works with the fix */
.modal.fade .modal-content {
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

/* Enhanced animation for signup */
#signupModal.fade .modal-content {
    transform: scale(0.94) translateY(15px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#signupModal.show .modal-content {
    transform: scale(1) translateY(0) !important;
}

/* Modal fade state */
.modal.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.modal.fade.show {
    opacity: 1 !important;
    display: flex !important;
}

/* ================= Modal Body ================= */
.modal-body {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1.25rem !important;
    background: #ffffff !important;
    min-height: 0 !important;
}

/* Force scrollable for signup modal body - Consolidated */
#signupModal .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--primary-green) #f5f5f5 !important;
    max-height: calc(100vh - 130px) !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    position: relative !important;
    padding: 0.7rem 0.8rem !important;
    background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%) !important;
}

/* Ensure scrolling is always enabled when modal is visible */
#signupModal.modal.show .modal-body,
#signupModal.show .modal-body,
#signupModal[style*="display: flex"] .modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 130px) !important;
}

/* Ensure form supports scrolling */
#signupModal #signupForm {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
}

/* Additional compact styling for signup */
#signupModal .btn-close {
    padding: 0.25rem !important;
    margin: -0.5rem -0.5rem -0.5rem auto !important;
    font-size: 0.875rem !important;
}

/* Signup modal body styles consolidated above */

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
    margin: 4px 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-green), var(--deep-emerald));
    border-radius: 10px;
    transition: background 0.3s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--deep-emerald), var(--primary-green));
}

/* Signup modal scrollbar - consolidated above */

/* Modal content styles consolidated above - removed duplicate */

.modal-header {
    flex-shrink: 0 !important;
    padding: 1rem 1.25rem 0.875rem !important;
    border-bottom: 1px solid #f0f0f0 !important;
    background: linear-gradient(135deg, #f8faf9 0%, #ffffff 100%) !important;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-green), transparent);
    opacity: 0.3;
}

.modal-title {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: var(--primary-green) !important;
    letter-spacing: -0.5px;
    text-align: center;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-green), var(--deep-emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smaller header for signup */
#signupModal .modal-header {
    padding: 0.625rem 0.875rem 0.5rem !important;
    background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%) !important;
    flex-shrink: 0 !important;
}

#signupModal .modal-title {
    font-size: 1.1rem !important;
}

.modal-footer {
    flex-shrink: 0 !important;
    padding: 0.875rem 1.25rem !important;
    border-top: 1px solid #f0f0f0 !important;
    background: #fafafa !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Smaller footer for signup */
#signupModal .modal-footer {
    padding: 0.5rem 0.875rem !important;
}

/* Duplicate styles removed - consolidated above */

/* Ensure body doesn't scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

/* ================= Form Interactivity ================= */
#signupForm,
#signupForm *,
#loginForm,
#loginForm * {
    pointer-events: auto !important;
}

/* Blur filters removed - consolidated in .modal-content above */

/* ================= Form Input Focus States ================= */
.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    outline: none !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1), 0 4px 12px rgba(45, 106, 79, 0.15) !important;
}

/* Enhanced button styling for modals */
.modal-content .btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--deep-emerald) 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-content .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modal-content .btn-primary:hover::before {
    left: 100%;
}

/* Smaller button for signup */
#signupModal .btn-primary {
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    box-shadow: 0 3px 10px rgba(45, 106, 79, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.modal-content .btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(45, 106, 79, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, var(--deep-emerald) 0%, var(--primary-green) 100%);
}

.modal-content .btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#signupModal .btn-primary:hover {
    box-shadow: 0 6px 18px rgba(45, 106, 79, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Better spacing for form elements */
#signupForm .form-control {
    margin-bottom: 0;
}

#signupForm .mb-3 {
    margin-bottom: 0.625rem !important;
}

#signupForm .mb-4 {
    margin-bottom: 0.75rem !important;
}

#signupForm .mb-2 {
    margin-bottom: 0.5rem !important;
}

#signupForm .row {
    margin-bottom: 0;
}

#signupForm .row .form-control {
    margin-bottom: 0;
}

#signupForm .row.g-2 {
    gap: 0.35rem !important;
}

/* Enhanced text styling */
.modal-body small.text-muted {
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
    display: block;
    margin-top: 0.25rem;
    padding: 0 2px;
}

/* Smaller text for signup */
#signupModal .modal-body small.text-muted {
    font-size: 10px;
    line-height: 1.35;
    margin-top: 0.2rem;
    color: #6b7280;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

#signupModal .modal-body small.text-muted:hover {
    opacity: 1;
}

/* Alert styling in modals */
.modal-body .alert {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    border-left: 4px solid;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.modal-body .alert:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateX(2px);
}

/* Smaller alert for signup */
#signupModal .modal-body .alert {
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 7px;
    margin-bottom: 0.75rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.modal-footer small.text-muted {
    font-size: 13px;
    color: #6b7280;
}

/* Smaller footer text for signup */
#signupModal .modal-footer small.text-muted {
    font-size: 11px;
}

.modal-footer a {
    color: var(--primary-green) !important;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 2px 4px;
    border-radius: 4px;
}

.modal-footer a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: width 0.3s ease;
}

.modal-footer a:hover {
    color: var(--deep-emerald) !important;
    background: rgba(45, 106, 79, 0.05);
}

.modal-footer a:hover::after {
    width: 100%;
}

/* ================= Logo Styles ================= */
.logo {
    width: 160px;
    height: 160px;
    border: 8px solid rgba(255,255,255,0.2);
    transform: rotateX(10deg) rotateY(-10deg);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.4));
    pointer-events: none; /* Allows clicks to pass through the logo area if it overlaps buttons */
}

.logo:hover {
    transform: rotateX(0deg) rotateY(0deg) scale(1.1);
}

@keyframes backgroundScroll {
    from { transform: translate(0,0); }
    to { transform: translate(-50%, -50%); }
}

/* ================= 3D Card Effects (landing) ================= */
body.landing-page .card {
    border: none;
    border-radius: 30px;
    background: var(--glass-white);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-3d);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    transform-style: preserve-3d;
}

body.landing-page .card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(-2deg);
    box-shadow: 0 30px 60px rgba(45, 106, 79, 0.25);
}

body.landing-page .card h5 {
    transform: translateZ(30px);
    color: var(--primary-green);
}

/* ================= Interactive 3D Buttons ================= */
.btn {
    border-radius: 15px;
    padding: 1rem 2.5rem;
    font-weight: 700;
    transition: var(--transition-smooth);
    position: relative;
    border: none;
    overflow: hidden;
}

body.landing-page .btn-primary {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
    color: white;
    box-shadow: 0 8px 0 var(--brand-900);
}

body.landing-page .btn-primary:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 var(--brand-900);
}

body.landing-page .btn-primary:hover:not(.modal-content .btn-primary) {
    background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
    transform: translateY(-2px);
}

/* ================= Floating CTA Section ================= */
body.landing-page .cta {
    background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-600) 100%);
    border-radius: 50px;
    margin: 80px 5%;
    padding: 100px 20px;
    transform: skewY(-2deg);
    box-shadow: var(--shadow-strong);
}

.cta > div {
    transform: skewY(2deg); /* Un-skew the content inside */
}

/* ================= Utility Classes ================= */
.text-primary-green {
    color: var(--primary-green);
}

.bg-primary-green {
    background-color: var(--primary-green);
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: var(--shadow-3d);
}

/* ================= Animated 3D Features ================= */

/* ================= Typography - Headings ================= */
body.landing-page h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(120deg, var(--brand-700), var(--accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 50px;
    letter-spacing: -0.03em;
}

/* ================= Updates Section (List Style) ================= */
.updates .card {
    border-left: 8px solid var(--accent-orange);
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.updates .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ================= RESPONSIVE DESIGN - ALL DEVICES ================= */

/* Extra Large Devices (Large desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

/* Large Devices (Desktops, 1200px and up) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .container { max-width: 1140px; }
}

/* Medium-Large Devices (Small desktops, 992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container { max-width: 960px; }
    h2 { font-size: 2.5rem; }
}

/* Tablets (768px to 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container { max-width: 720px; }
    
    h2 { font-size: 2rem; margin-bottom: 30px; }
    
    header.hero { min-height: 85vh; clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%); }
    header.hero h1 { font-size: 2.5rem !important; }
    header.hero .lead { font-size: 1rem !important; }
    
    .logo { width: 120px; height: 120px; }
    
    .about .container { padding: 2rem; transform: none; }
    .about .container:hover { transform: none; }
    .about ul { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    
    .card { border-radius: 20px; }
    .card:hover { transform: translateY(-8px); }
    
    footer { clip-path: polygon(0 8%, 100% 0, 100% 100%, 0% 100%); padding: 40px 0 20px; }
    
    .btn { padding: 0.875rem 2rem; font-size: 0.95rem; }
}

/* Small Tablets & Large Phones (576px to 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container { max-width: 540px; }
    
    h2 { font-size: 1.75rem; margin-bottom: 25px; }
    
    header.hero { min-height: 80vh; clip-path: polygon(0 0, 100% 0, 100% 92%, 0% 100%); padding: 2rem 1rem; }
    header.hero h1 { font-size: 2rem !important; }
    header.hero .lead { font-size: 0.95rem !important; padding: 0 1rem; }
    
    .logo { width: 100px; height: 100px; border-width: 5px; }
    
    .about { padding: 60px 0; }
    .about .container { padding: 1.5rem; border-radius: 25px; transform: none; }
    .about ul { grid-template-columns: 1fr; }
    .about ul li { padding: 1.25rem; }
    
    .features .card { margin-bottom: 1rem; }
    
    .card { border-radius: 15px; }
    .card:hover { transform: translateY(-5px); }
    
    footer { clip-path: polygon(0 5%, 100% 0, 100% 100%, 0% 100%); padding: 30px 0 15px; }
    
    .btn { padding: 0.75rem 1.5rem; font-size: 0.9rem; border-radius: 12px; }
    
    /* Modal adjustments */
    .modal-dialog { width: 95% !important; margin: 1rem auto !important; }
    #signupModal .modal-dialog { max-width: 95% !important; }
    .modal-body { padding: 1rem !important; }
    #signupModal .modal-body { padding: 0.6rem 0.7rem !important; }
    .modal-header { padding: 0.875rem 1rem 0.75rem !important; }
    #signupModal .modal-header { padding: 0.5rem 0.75rem 0.4rem !important; }
    .modal-title { font-size: 1.2rem !important; }
    #signupModal .modal-title { font-size: 1rem !important; }
}

/* Mobile Phones (up to 575px) */
@media (max-width: 575.98px) {
    body { font-size: 14px; }
    
    .container { padding-left: 15px; padding-right: 15px; }
    
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem; margin-bottom: 20px; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    header.hero { 
        min-height: 75vh; 
        clip-path: polygon(0 0, 100% 0, 100% 95%, 0% 100%); 
        padding: 1.5rem 1rem;
    }
    header.hero h1 { font-size: 1.6rem !important; line-height: 1.3; }
    header.hero .lead { font-size: 0.9rem !important; padding: 0 0.5rem; line-height: 1.5; }
    header.hero .display-2 { font-size: 1.75rem !important; }
    
    .logo { width: 80px; height: 80px; border-width: 4px; }
    .logo-wrapper { margin-bottom: 1rem !important; }
    
    .hero-btns { flex-direction: column; gap: 0.75rem !important; }
    .hero-btns .btn { width: 100%; padding: 0.875rem 1.5rem; }
    
    .about { padding: 40px 0; }
    .about .container { 
        padding: 1.25rem; 
        border-radius: 20px; 
        transform: none !important; 
        margin: 0 10px;
    }
    .about ul { 
        grid-template-columns: 1fr; 
        gap: 12px;
        margin-top: 20px;
    }
    .about ul li { 
        padding: 1rem; 
        border-radius: 15px;
        transform: none !important;
    }
    .about ul li:hover { transform: none !important; }
    
    .features { padding: 40px 0; }
    .features .card { margin-bottom: 1rem; padding: 1.25rem !important; }
    
    .card { 
        border-radius: 15px; 
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .card:hover { transform: translateY(-3px); }
    .card h5 { transform: none; font-size: 1rem; }
    
    .cta { 
        margin: 40px 3%; 
        padding: 50px 15px; 
        border-radius: 25px;
        transform: none;
    }
    .cta > div { transform: none; }
    .cta h2 { font-size: 1.4rem; }
    
    footer { 
        clip-path: polygon(0 3%, 100% 0, 100% 100%, 0% 100%); 
        padding: 25px 0 15px;
        margin-top: -15px;
    }
    footer h5, footer h6 { font-size: 0.9rem; }
    footer p, footer a, footer li { font-size: 0.85rem; }
    
    .btn { 
        padding: 0.7rem 1.25rem; 
        font-size: 0.85rem; 
        border-radius: 10px;
    }
    .btn-lg { padding: 0.875rem 1.5rem; font-size: 0.95rem; }
    
    /* Modal - Full screen on mobile */
    .modal-dialog { 
        width: 98% !important; 
        margin: 0.5rem auto !important;
        max-width: none !important;
    }
    #signupModal .modal-dialog { max-width: 98% !important; }
    
    .modal-content { border-radius: 15px !important; }
    #signupModal .modal-content { border-radius: 10px !important; }
    
    .modal-body { padding: 0.875rem !important; }
    #signupModal .modal-body { padding: 0.5rem 0.6rem !important; }
    
    .modal-header { padding: 0.75rem 1rem !important; }
    #signupModal .modal-header { padding: 0.5rem 0.75rem !important; }
    
    .modal-footer { padding: 0.75rem 1rem !important; }
    #signupModal .modal-footer { padding: 0.4rem 0.6rem !important; }
    
    .modal-title { font-size: 1.1rem !important; }
    #signupModal .modal-title { font-size: 0.95rem !important; }
    
    .form-control { 
        padding: 10px 14px; 
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }
    #signupModal .form-control { 
        padding: 8px 12px; 
        font-size: 16px;
    }
    
    .modal-content .btn-primary { 
        padding: 10px 16px; 
        font-size: 14px;
        width: 100%;
    }
    #signupModal .btn-primary { 
        padding: 9px 14px !important; 
        font-size: 13px !important;
    }
    
    /* Table responsiveness */
    .table-responsive { 
        font-size: 0.85rem;
        -webkit-overflow-scrolling: touch;
    }
    .table th, .table td { 
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }
    
    /* Navbar mobile */
    .navbar { padding: 0.5rem 0; }
    .navbar-brand { font-size: 1.1rem; }
    .navbar-toggler { padding: 0.25rem 0.5rem; }
    
    /* Cards stack on mobile */
    .row > [class*="col-"] { margin-bottom: 1rem; }
    
    /* Hide less important elements on mobile */
    .d-mobile-none { display: none !important; }
}

/* Extra Small Phones (up to 375px) */
@media (max-width: 375px) {
    body { font-size: 13px; }
    
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.35rem; }
    
    header.hero h1 { font-size: 1.4rem !important; }
    header.hero .lead { font-size: 0.85rem !important; }
    
    .logo { width: 70px; height: 70px; }
    
    .btn { padding: 0.6rem 1rem; font-size: 0.8rem; }
    
    .about .container { padding: 1rem; }
    .about ul li { padding: 0.875rem; }
    
    .modal-title { font-size: 1rem !important; }
    
    .card { padding: 1rem !important; }
}

/* Landscape orientation for phones */
@media (max-width: 767.98px) and (orientation: landscape) {
    header.hero { 
        min-height: 100vh; 
        padding: 1rem;
    }
    header.hero h1 { font-size: 1.5rem !important; }
    
    .logo { width: 60px; height: 60px; }
    
    .modal-dialog { margin: 0.25rem auto !important; }
    .modal-content { max-height: 95vh !important; }
    .modal-body { max-height: 60vh !important; }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .card:hover { transform: none; }
    .about .container:hover { transform: none; }
    .about ul li:hover { transform: none; background: white; }
    .btn:hover { transform: none; }
    
    /* Larger touch targets */
    .btn { min-height: 44px; }
    .form-control { min-height: 44px; }
    a { padding: 0.25rem; }
    
    /* Remove hover-dependent effects */
    .features .card::before { display: none; }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo { image-rendering: -webkit-optimize-contrast; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles here if needed */
}

/* ================= Print Styles ================= */
@media print {
    .modal,
    .modal-backdrop {
        display: none !important;
    }
    
    body.modal-open {
        overflow: visible !important;
    }
}

/* ================= Performance Optimizations ================= */
.modal-content,
.modal-body,
.modal-header,
.modal-footer {
    will-change: transform, opacity;
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}