/*
Theme Name: BioArabia
Theme URI: https://bioarabia.media/
Author: Sergey Shemedinov
Author URI: https://t.me/sega207/
Description: Scientific Research Platform Theme with ACF Pro and Gutenberg Blocks
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bioarabia
*/

:root {
  /* Colors - Based on Logo (#3eb761 green, #4281c3 blue) */
  --primary-deep: #0a1628;
  --primary-main: #122240;
  --primary-light: #1e3a5f;
  --accent-blue: #4281c3;
  --accent-green: #3eb761;
  --accent-cyan: #3ecfb2;
  --neutral-dark: #0a1628;
  --neutral-medium: #64748b;
  --neutral-light: #f8fafc;
  --white: #ffffff;
  --border-color: #e2e8f0;
  
  /* Typography */
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Spacing */
  --section-padding: clamp(60px, 10vw, 120px);
  --container-max: 1400px;
  
  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--neutral-dark);
  background: var(--neutral-light);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

h4 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
}

/* Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 80px);
}

/* Section */
.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-padding {
  padding: 100px 0;
}

.section-bg-white {
  background: var(--white);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(66, 129, 195, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(66, 129, 195, 0.35);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
}

.btn-outline:hover {
  background: var(--accent-blue);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline-white {
  border-color: rgba(255,255,255,0.3);
  color: white;
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
}

/* DearFlip / Flipbook Button Styles */
.journal-button {
  margin-top: 8px;
}

.journal-button ._df_button,
.journal-button .df-popup-button,
.journal-button a[data-df-lightbox],
.journal-button [class*="_df_button"] {
  display: inline-block;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
  color: var(--white) !important;
  box-shadow: 0 4px 14px rgba(66, 129, 195, 0.25);
  text-decoration: none;
  font-family: var(--font-body);
  line-height: 1.5;
}

.journal-button ._df_button:hover,
.journal-button .df-popup-button:hover,
.journal-button a[data-df-lightbox]:hover,
.journal-button [class*="_df_button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(66, 129, 195, 0.35);
  color: var(--white) !important;
  text-decoration: none;
}

/* Override DearFlip default styles */
.journal-button ._df_button.df-has-ridge,
.journal-button .df-element {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(66, 129, 195, 0.25) !important;
}

.journal-button ._df_button.df-has-ridge:hover,
.journal-button .df-element:hover {
  box-shadow: 0 8px 20px rgba(66, 129, 195, 0.35) !important;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.header.scrolled {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-deep);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  max-height: 50px;
  width: auto;
}

/* Navigation */
.nav-menu {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.nav-menu a {
  font-size: 15px;
  font-weight: 500;
  color: var(--neutral-medium);
  position: relative;
  padding: 8px 0;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--accent-blue);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--primary-main);
  transition: var(--transition-smooth);
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Header Navigation Container */
.header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Header Social Links */
.social-links-header {
  display: flex;
  gap: 8px;
}

.social-links-header .social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 6px;
  transition: var(--transition-smooth);
  border: 1px solid var(--border-color);
}

.social-links-header .social-link:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.social-links-header .social-link:hover svg {
  fill: var(--white);
}

.social-links-header .social-link svg {
  width: 18px;
  height: 18px;
  fill: var(--neutral-medium);
  transition: fill 0.3s ease;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary-main) 50%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(66, 129, 195, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(62, 183, 97, 0.15) 0%, transparent 50%);
  opacity: 0.8;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 800px;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 400;
  margin-bottom: 40px;
  opacity: 0.95;
  animation: fadeInUp 0.8s ease 0.2s both;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.4s both;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition-smooth);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  border-color: var(--accent-blue);
}

.card-image {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(40px);
}

.card-content {
  padding: 28px;
}

.card h3 {
  color: var(--primary-deep);
  margin-bottom: 12px;
  font-weight: 700;
}

.card p {
  color: var(--neutral-medium);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 40px;
}

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

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

/* Journals Grid - Single Column */
.journals-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.journal-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition-smooth);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.journal-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  border-color: var(--accent-blue);
}

.journal-card .card-image {
  height: 100%;
  min-height: 240px;
}

.journal-card .card-image-custom {
  background: var(--neutral-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.journal-card .card-image-custom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.journal-card:hover .card-image-custom img {
  transform: scale(1.05);
}

.journal-card .card-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.journal-card .card-content .btn {
  align-self: flex-start;
  margin-top: 8px;
}

/* Section Headings */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  margin-bottom: 12px;
  padding: 6px 16px;
  background: rgba(66, 129, 195, 0.1);
  border-radius: 20px;
}

.section-title {
  color: var(--primary-deep);
  margin-bottom: 16px;
}

.section-description {
  font-size: 18px;
  color: var(--neutral-medium);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Gradient Backgrounds */
.gradient-blue-purple,
.gradient-blue-green {
  background: linear-gradient(135deg, #4281c3 0%, #3eb761 100%);
}

.gradient-cyan-purple,
.gradient-cyan-green {
  background: linear-gradient(135deg, #3ecfb2 0%, #3eb761 100%);
}

.gradient-green-blue {
  background: linear-gradient(135deg, #3eb761 0%, #4281c3 100%);
}

/* White on Gradient */
.white-on-gradient {
  color: var(--white);
  padding: 60px;
  border-radius: 16px;
  text-align: center;
}

.white-on-gradient h3 {
  color: white;
  margin-bottom: 16px;
}

.white-on-gradient p {
  font-size: 1.0625rem;
  opacity: 0.95;
}

.white-on-gradient svg {
  margin: 0 auto 24px;
}

/* Contact Form Styles */
.contact-form {
  background: var(--white);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--neutral-dark);
  font-size: 14px;
}

.form-input,
.form-textarea,
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition-smooth);
  background: var(--white);
}

.form-input:focus,
.form-textarea:focus,
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(66, 129, 195, 0.1);
}

.form-textarea,
.wpcf7 textarea {
  min-height: 150px;
  resize: vertical;
}

.form-input.error,
.form-textarea.error,
.wpcf7-not-valid {
  border-color: #f44336;
}

/* CF7 Submit Button */
.wpcf7 input[type="submit"] {
  display: inline-block;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-green) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(66, 129, 195, 0.25);
}

.wpcf7 input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(66, 129, 195, 0.35);
}

/* CF7 Messages */
.wpcf7-response-output {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
}

.wpcf7-mail-sent-ok {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.wpcf7-validation-errors {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* Departments Box */
.departments-box {
  background: var(--neutral-light);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.departments-title {
  margin-bottom: 20px;
  font-size: 1.25rem;
  color: var(--primary-deep);
}

.departments-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.departments-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--neutral-dark);
}

.departments-list li:last-child {
  border-bottom: none;
}

.department-bullet {
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 16px;
}

.social-link {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-light);
  border-radius: 8px;
  transition: var(--transition-smooth);
  border: 1px solid var(--border-color);
}

.social-link:hover {
  background: var(--accent-blue);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(66, 129, 195, 0.3);
}

.social-link:hover svg {
  fill: var(--white);
}

.social-link svg {
  width: 24px;
  height: 24px;
  transition: fill 0.3s ease;
}

/* Partners Section */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 40px;
  align-items: center;
  justify-items: center;
}

.partner-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: var(--transition-smooth);
}

.partner-item img {
  max-width: 150px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: var(--transition-smooth);
}

.partner-item:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

.partner-link {
  display: block;
}

.partners-placeholder {
  text-align: center;
  padding: 40px;
  background: var(--neutral-light);
  border-radius: 16px;
  color: var(--neutral-medium);
}

@media (max-width: 768px) {
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .partner-item img {
    max-width: 120px;
    max-height: 60px;
  }
}

@media (max-width: 480px) {
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .partner-item {
    padding: 12px;
  }
  
  .partner-item img {
    max-width: 100px;
    max-height: 50px;
  }
}

/* Footer */
.footer {
  background: var(--primary-deep);
  color: var(--white);
  padding: 60px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 20px;
  font-weight: 700;
}

.footer-section p {
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
}

.footer-logo {
  max-height: 60px;
  width: auto;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition-smooth);
  font-size: 15px;
}

.footer-links a:hover {
  color: var(--accent-blue);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Utilities */
.text-large {
  font-size: 1.125rem;
}

.text-medium {
  color: var(--neutral-medium);
}

.line-height-relaxed {
  line-height: 1.7;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-30 {
  margin-bottom: 30px;
}

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

.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Gutenberg Editor Styles */
.wp-block-bioarabia-hero,
.wp-block-bioarabia-about,
.wp-block-bioarabia-services,
.wp-block-bioarabia-journals,
.wp-block-bioarabia-contact {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 992px) {
  .journal-card {
    grid-template-columns: 1fr;
  }
  
  .journal-card .card-image {
    min-height: 200px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    transition: left 0.4s ease;
    padding: 40px;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .btn {
    text-align: center;
  }

  .white-on-gradient {
    padding: 40px 28px;
  }
  
  .social-links-header {
    display: none;
  }
}

@media (max-width: 480px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}