/**
 * Melody Pharma Theme - Custom Styles
 * Additional styles for enhanced design elements
 *
 * @package MelodyPharma
 * @since 1.0.0
 */

/* ============================================
   ENHANCED HERO SECTION
   ============================================ */
.mp-hero {
    position: relative;
    background-color: var(--mp-navy-dark);
}

.mp-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0,31,63,0.9), transparent);
    z-index: 1;
}

/* Animated gradient overlay */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.mp-hero::before {
    background: linear-gradient(
        135deg,
        rgba(0,31,63,0.9) 0%,
        rgba(0,102,51,0.8) 50%,
        rgba(0,51,102,0.85) 100%
    );
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* ============================================
   LOGO STYLING
   ============================================ */
.mp-hero-logo {
    background: rgba(255,255,255,0.95);
    padding: 15px 25px;
    border-radius: var(--mp-radius-lg);
    box-shadow: var(--mp-shadow-lg);
    border: 3px solid var(--mp-red-border);
    display: inline-block;
}

/* Custom logo image styling */
.mp-hero-logo .custom-logo,
.mp-hero-logo-img,
.mp-hero-logo img.custom-logo {
    max-width: 100%;
    height: auto;
    display: block;
    max-height: 200px;
}

/* Placeholder logo (only shows when no custom logo) */
.mp-hero-logo > img:not(.custom-logo) {
    max-width: 100%;
    height: auto;
    display: block;
    max-height: 200px;
}

.mp-hero-logo-link {
    display: block;
    text-decoration: none;
}

/* Hide placeholder when custom logo exists - multiple selectors for browser compatibility */
.mp-hero-logo:has(.custom-logo) > img:not(.custom-logo),
.mp-hero-logo .custom-logo-link ~ img:not(.custom-logo),
.mp-hero-logo img[src*="themes/melodypharma-theme/assets/images/logo.png"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Ensure custom logo is visible */
.mp-hero-logo .custom-logo-link,
.mp-hero-logo .custom-logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */
.mp-btn {
    position: relative;
    overflow: hidden;
}

.mp-btn::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 ease;
}

.mp-btn:hover::before {
    left: 100%;
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */
.mp-partner-card,
.mp-vm-card,
.mp-value-card,
.mp-contact-card {
    position: relative;
    overflow: hidden;
}

.mp-partner-card::before,
.mp-vm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--mp-gradient-green);
    transition: height var(--mp-transition-medium);
}

.mp-partner-card:hover::before,
.mp-vm-card:hover::before {
    height: 100%;
}

/* ============================================
   TABLE ENHANCEMENTS
   ============================================ */
.mp-products-table {
    font-size: 0.95rem;
}

.mp-products-table thead th {
    position: relative;
    overflow: hidden;
}

.mp-products-table thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--mp-green-light);
}

.mp-products-table tbody tr {
    transition: all var(--mp-transition-fast);
}

.mp-products-table tbody tr:hover {
    background: rgba(0,102,51,0.05);
    transform: scale(1.01);
}

/* Category badges with different colors */
.category-badge.anti-inflammatory {
    background: #e74c3c;
}

.category-badge.metabolic {
    background: #3498db;
}

.category-badge.cardiovascular {
    background: #9b59b6;
}

.category-badge.antibiotics {
    background: #e67e22;
}

.category-badge.infusions {
    background: #1abc9c;
}

.category-badge.nutraceuticals {
    background: #27ae60;
}

.category-badge.dermatologicals {
    background: #f39c12;
}

.category-badge.antihistamines {
    background: #2980b9;
}

.category-badge.neurological {
    background: #8e44ad;
}

/* ============================================
   FORM STYLES
   ============================================ */
.mp-form-group input:focus,
.mp-form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(0,102,51,0.2);
}

.form-message {
    padding: 15px 20px;
    border-radius: var(--mp-radius-md);
    margin-bottom: 20px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   SCROLLED NAVIGATION
   ============================================ */
.mp-main-nav.scrolled {
    background: rgba(255,255,255,0.98);
    box-shadow: var(--mp-shadow-md);
}

/* ============================================
   PAGE HEADERS
   ============================================ */
.mp-page-header {
    background: var(--mp-gradient-navy);
    padding: 120px 0 80px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.mp-page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(0,102,51,0.3) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

.mp-page-header h1 {
    color: white;
    position: relative;
    z-index: 1;
}

.mp-page-header p {
    color: rgba(255,255,255,0.9);
    position: relative;
    z-index: 1;
}


/* ============================================
   MAP STYLING
   ============================================ */
.mp-map-container {
    position: relative;
}

.mp-map-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: var(--mp-gradient-green);
    border-radius: calc(var(--mp-radius-lg) + 5px);
    z-index: -1;
}

/* ============================================
   LOADING STATES
   ============================================ */
.mp-loading {
    position: relative;
    pointer-events: none;
}

.mp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(0,102,51,0.2);
    border-top-color: var(--mp-green-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   TOOLTIP
   ============================================ */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--mp-navy-dark);
    color: white;
    font-size: 0.85rem;
    border-radius: var(--mp-radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--mp-transition-fast);
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media screen and (max-width: 768px) {
    .mp-page-header {
        padding: 100px 20px 60px;
    }
    
    .mp-page-header h1 {
        font-size: 2rem;
    }
    
    .mp-hero-logo {
        max-width: 150px;
        padding: 10px 15px;
    }
    
    .mp-map-container::before {
        display: none;
    }
    
    /* Responsive font sizes for inline styles */
    .mp-about-section p[style*="font-size: 1.1rem"] {
        font-size: 1rem !important;
    }
    
    .mp-about-section h3[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }
    
    .mp-about-section p[style*="font-size: 1rem"] {
        font-size: 0.9rem !important;
    }
    
    .mp-about-section p[style*="font-size: 1.15rem"] {
        font-size: 1rem !important;
    }
    
    /* OMAB Group box padding */
    .mp-about-section div[style*="padding: 50px"] {
        padding: 30px 20px !important;
    }
    
    /* Vision/Mission card padding */
    .mp-vm-card[style*="padding: 40px"] {
        padding: 30px 20px !important;
    }
    
    /* CTA section */
    section[style*="padding: 80px 0"] {
        padding: 50px 0 !important;
    }
    
    section[style*="padding: 80px 0"] h2[style*="font-size: 2.5rem"] {
        font-size: 2rem !important;
    }
    
    section[style*="padding: 80px 0"] p[style*="font-size: 1.2rem"] {
        font-size: 1rem !important;
    }
}

@media screen and (max-width: 480px) {
    .mp-about-section p[style*="font-size: 1.1rem"] {
        font-size: 0.95rem !important;
    }
    
    .mp-about-section h3[style*="font-size: 2rem"] {
        font-size: 1.35rem !important;
    }
    
    .mp-about-section div[style*="padding: 50px"] {
        padding: 25px 15px !important;
    }
    
    .mp-vm-card[style*="padding: 40px"] {
        padding: 25px 15px !important;
    }
    
    section[style*="padding: 80px 0"] {
        padding: 40px 0 !important;
    }
    
    section[style*="padding: 80px 0"] h2[style*="font-size: 2.5rem"] {
        font-size: 1.75rem !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .mp-top-strip,
    .mp-main-nav,
    .mp-hero,
    .mp-wave-divider,
    .mp-footer {
        display: none !important;
    }
    
    .mp-products-table {
        box-shadow: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* ============================================
   CONTACT FORM 7 STYLING
   ============================================ */
.wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wpcf7-form p {
    margin: 0;
}

.wpcf7-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--mp-navy-dark);
    font-size: 0.95rem;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--mp-radius-md);
    font-family: var(--mp-font-primary);
    font-size: 1rem;
    transition: all var(--mp-transition-fast);
    background: white;
    box-sizing: border-box;
}

.wpcf7-form input[type="text"]::placeholder,
.wpcf7-form input[type="email"]::placeholder,
.wpcf7-form textarea::placeholder {
    color: #999;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form input[type="url"]:focus,
.wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--mp-green-dark);
    box-shadow: 0 0 0 3px rgba(0,102,51,0.1);
}

.wpcf7-form textarea {
    min-height: 120px;
    resize: vertical;
}

.wpcf7-form input[type="submit"] {
    background: var(--mp-gradient-green);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: var(--mp-radius-md);
    font-family: var(--mp-font-primary);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--mp-transition-fast);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wpcf7-form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--mp-shadow-lg);
}

.wpcf7-form input[type="submit"]:active {
    transform: translateY(0);
}

.wpcf7-response-output {
    padding: 15px 20px;
    border-radius: var(--mp-radius-md);
    margin-top: 20px;
    font-size: 0.95rem;
}

.wpcf7-mail-sent-ok {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block !important;
    animation: fadeIn 0.3s ease;
}

.wpcf7-mail-sent-ng,
.wpcf7-aborted,
.wpcf7-spam,
.wpcf7-validation-errors {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block !important;
    animation: fadeIn 0.3s ease;
}

/* Hide validation errors when form is valid or success message appears */
.wpcf7-form:not(.invalid) .wpcf7-validation-errors:empty {
    display: none !important;
}

.wpcf7-mail-sent-ok ~ .wpcf7-validation-errors,
.wpcf7-form .wpcf7-mail-sent-ok + .wpcf7-validation-errors {
    display: none !important;
}

.wpcf7-not-valid-tip {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
    animation: fadeIn 0.3s ease;
}

.wpcf7-not-valid {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

/* Remove invalid styling when field becomes valid */
.wpcf7-form input:not(.wpcf7-not-valid),
.wpcf7-form textarea:not(.wpcf7-not-valid) {
    border-color: #e0e0e0;
}

.wpcf7-form input:not(.wpcf7-not-valid):focus,
.wpcf7-form textarea:not(.wpcf7-not-valid):focus {
    border-color: var(--mp-green-dark);
    box-shadow: 0 0 0 3px rgba(0,102,51,0.1);
}

.wpcf7 .ajax-loader {
    margin-left: 10px;
}

/* ============================================
   ELEMENTOR COMPATIBILITY
   ============================================ */
.elementor-page .mp-hero,
.elementor-page .mp-stats,
.elementor-page .mp-vision-mission,
.elementor-page .mp-partners {
    /* Allow Elementor to control these sections when edited */
}

/* Elementor section backgrounds */
.elementor-section.mp-green-gradient {
    background: var(--mp-gradient-green) !important;
}

.elementor-section.mp-navy-bg {
    background: var(--mp-navy-dark) !important;
}

/* Elementor button overrides */
.elementor-button.mp-style {
    background: var(--mp-gradient-green) !important;
    border-radius: var(--mp-radius-md) !important;
    font-family: var(--mp-font-primary) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.elementor-button.mp-style:hover {
    transform: translateY(-3px);
    box-shadow: var(--mp-shadow-lg);
}

