/**
 * PMWaves Components CSS
 * Consolidated and optimized component styles
 * FIXED: Navigation responsive issues, burger animation, spacing
 */

/* ========================================
   CONTAINERS & LAYOUT
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-modern {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-container {
    padding-top: 70px; /* Fixed navbar height - SINGLE SOURCE OF TRUTH */
    min-height: 100vh;
}

/* ========================================
   NAVBAR - FIXED RESPONSIVE
   ======================================== */

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px; /* Fixed height at all breakpoints */
    z-index: 1000;
    transition: var(--transition-fast);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
}

.navbar .flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 1rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: none;
}

.logo-text {
    margin-top: 0;
    font-size: 1.5rem;
}

.logo-text, 
.logo-text:hover, 
.logo a, 
.logo a:hover {
    text-decoration: none !important;
}

.logo-image {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
}

.logo-image img { 
    display: block; 
    width: 40px; 
    height: 40px; 
}

/* Desktop Navigation Menu */
.navbar-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.navbar-menu a {
    color: #2c3e50;
    text-decoration: none;
    padding: 5px 10px;
    font-size: 20px;
    transition: var(--transition-fast);
    display: inline-block;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

.navbar-menu li.active > a {
    border-bottom: 2px solid var(--primary-color);
}

/* Language buttons */
.language-selector {
    flex-shrink: 0;
}

.language-selector .lang-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-option {
    border: 1px solid transparent;
    background: transparent;
    padding: 6px 10px;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    color: #2c3e50;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.lang-option:hover { 
    border-color: rgba(0, 0, 0, 0.12); 
}

.lang-option.selected {
    font-weight: 700;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   BURGER BUTTON - WITH X ANIMATION
   ======================================== */

.navbar-toggle {
    display: none; /* Hidden on desktop */
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
    padding: 10px;
    flex-shrink: 0;
}

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

.navbar-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #2c3e50;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Position the three bars */
.navbar-toggle-bar:nth-child(1) {
    top: 12px;
}

.navbar-toggle-bar:nth-child(2) {
    top: 21px;
}

.navbar-toggle-bar:nth-child(3) {
    top: 30px;
}

/* X Animation when menu is open */
.navbar-toggle.is-active .navbar-toggle-bar:nth-child(1) {
    top: 21px;
    transform: translateX(-50%) rotate(45deg);
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-50%) scaleX(0);
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(3) {
    top: 21px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Body lock when menu open */
body.no-scroll { 
    overflow: hidden; 
}

/* ========================================
   BUTTONS - Consolidated
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2a5298);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-secondary:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

/* ========================================
   CARDS - Single Definition
   ======================================== */

.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   FAQ - Optimized Single Version
   ======================================== */

.faq-item {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(52, 152, 219, 0.1);
    padding-bottom: 1rem;
}

.faq-question {
    cursor: pointer;
    border-radius: 4px;
    color: #2c3e50;
    font-weight: 600;
    transition: var(--transition-fast);
    user-select: none;
    position: relative;
}

.faq-question:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.faq-question.active {
    color: #2a5298;
    font-weight: 700;
}

.faq-question::before {
    content: '→';
    margin-right: 8px;
    color: #3498db;
    transition: var(--transition-fast);
    display: inline-block;
}

.faq-question.active::before {
    transform: rotate(90deg);
}

.faq-answer {
    display: none;
    padding: 12px 20px;
    margin-top: 8px;
    margin-left: 20px;
    color: #5a6c7d;
    line-height: 1.7;
    animation: fadeInAnswer 0.3s ease;
}

.faq-answer.active {
    display: block;
}

/* ========================================
   FORMS - Consolidated
   ======================================== */

.form-control {
    margin-bottom: 1.5rem;
}

.form-control input[type='text'],
.form-control input[type='email'],
.form-control input[type='tel'],
.form-control textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #b4becb;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition-fast);
    font-family: inherit;
}

.form-control input:focus,
.form-control textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #f8f9fa;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ========================================
   GRIDS & FLEXBOX - Utility Classes
   ======================================== */

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flex {
    display: flex;
    align-items: center;
}

.flex-center {
    justify-content: center;
}

.flex-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* ========================================
   ANIMATIONS - Consolidated
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInAnswer {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Animation Classes */
.fade-in {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* ========================================
   UTILITY CLASSES - Consolidated
   ======================================== */

/* Spacing - Using CSS Variables */
.m-1 { margin: var(--spacing-sm); }
.m-2 { margin: var(--spacing-md); }
.m-3 { margin: var(--spacing-lg); }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ========================================
   RESPONSIVE DESIGN - FIXED BREAKPOINTS
   ======================================== */

/* TABLET/MEDIUM - 850px and below */
@media (max-width: 850px) {
    /* Navbar stays 70px height */
    .navbar {
        height: 70px;
    }
    
    .navbar .flex {
        flex-direction: row;
        align-items: center;
        padding: 0 0.75rem;
        height: 70px;
    }

    /* Show burger button */
    .navbar-toggle { 
        display: block;
        order: 3; /* Put burger last */
    }

    /* Language selector positioning */
    .language-selector { 
        margin-left: auto;
        order: 2;
    }

    /* Logo first */
    .logo {
        order: 1;
    }

    /* Mobile menu - slides down from navbar */
    .navbar-menu {
        position: fixed;
        top: 70px; /* Match navbar height exactly */
        right: 0;
        left: 0;
        max-height: 0;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
        transition: max-height 0.3s ease;
        z-index: 999;
    }
    
    .navbar-menu.is-open {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .navbar-menu ul {
        flex-direction: column;
        width: 100%;
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .navbar-menu a {
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 10px;
        display: block;
    }
 
	/*
    .navbar-menu li.active {
        border-bottom: 0;
    }
    
    .navbar-menu li.active > a {
        background: rgba(52, 152, 219, 0.1);
        color: var(--primary-color);
        border-left: 3px solid var(--primary-color);
    }
	*/
	
	.navbar-menu li.active {
		border-bottom: none;
	}

	.navbar-menu li.active > a {
		border-bottom: none;
		color: var(--primary-color);
		position: relative;
	}

	.navbar-menu li.active > a::after {
		content: '';
		position: absolute;
		bottom: 0;
		left: 16px;
		right: 16px;
		height: 2px;
		background-color: var(--primary-color);
	}

    /* Page container - consistent padding */
    .page-container { 
        padding-top: 70px; /* Same as navbar height */
    }
    
    /* Grid Responsive */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Container */
    .container,
    .container-modern {
        padding: 0 15px;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Logo text adjustment */
    .logo-text {
        font-size: 1.3rem;
    }
}

/* SMALL TABLET - 750px and below */
@media (max-width: 750px) {
    .navbar {
        height: 70px;
    }
    
    .page-container {
        padding-top: 70px;
    }

    .logo-text {
        font-size: 1.2rem;
    }
    
    .navbar-menu a {
        font-size: 15px;
        padding: 12px 14px;
    }
}

/* MOBILE - 500px and below */
@media (max-width: 500px) {
    .navbar {
        height: 70px; /* Keep consistent */
    }
    
    .navbar .flex {
        padding: 0 10px;
    }
    
    .page-container {
        padding-top: 70px;
    }

    .logo-text { 
        font-size: 1.1rem; 
    }

    .logo-image {
        width: 35px;
        height: 35px;
        margin-right: 8px;
    }

    .logo-image img {
        width: 35px;
        height: 35px;
    }

    /* Language selector compact */
    .lang-option {
        padding: 5px 8px;
        font-size: 0.85rem;
    }

    .language-selector .lang-group {
        gap: 0.25rem;
    }

    /* Burger button */
    .navbar-toggle {
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .navbar-toggle-bar {
        width: 22px;
    }

    .navbar-toggle-bar:nth-child(1) {
        top: 11px;
    }

    .navbar-toggle-bar:nth-child(2) {
        top: 19px;
    }

    .navbar-toggle-bar:nth-child(3) {
        top: 27px;
    }

    .navbar-toggle.is-active .navbar-toggle-bar:nth-child(1),
    .navbar-toggle.is-active .navbar-toggle-bar:nth-child(3) {
        top: 19px;
    }
}

/* EXTRA SMALL - 380px and below */
@media (max-width: 380px) {
    .logo-text {
        font-size: 1rem;
    }

    .logo-image {
        width: 32px;
        height: 32px;
        margin-right: 6px;
    }

    .logo-image img {
        width: 32px;
        height: 32px;
    }

    .lang-option {
        padding: 4px 6px;
        font-size: 0.8rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 9999;
}

.skip-to-content:focus {
    top: 0;
}