/*
Theme Name: Cyber Security Portfolio V2
Theme URI: https://github.com/kodexmia/cyber-portfolio
Author: Kodexmia
Author URI: https://kodexmia.com
Description: Clean, professional cyber security portfolio theme with customizable colors and simple content management. Fully mobile responsive with working hamburger menu.
Version: 2.3.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cyber-portfolio
Tags: portfolio, security, education, customizable, responsive
*/

/* ===========================
   CSS Variables
   =========================== */
:root {
  --bg-main: #f8f9fa;
  --bg-alt: #ffffff;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --text-main: #2c3e50;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --border-subtle: #e1e4e8;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* ===========================
   Base Styles
   =========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.page-wrap {
  min-height: 100vh;
  background: linear-gradient(to right, #f8fafc, #ffffff);
}

/* ===========================
   Header & Navigation
   =========================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 15px rgba(0,0,0,0.03);
}

body.admin-bar header {
  top: 32px;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
  z-index: 1001;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

/* Mobile Menu Toggle (Hamburger) */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-main);
  border-radius: 3px;
  transition: all 0.3s ease;
}

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

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

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

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  font-size: 0.9rem;
}

.main-nav a {
  color: var(--text-muted);
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  display: block;
}

.main-nav a:hover,
.main-nav a.current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-cv-btn {
  display: flex;
}

.btn-small {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-small:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* ===========================
   Main Content
   =========================== */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

body.admin-bar main {
  padding-top: 8rem;
}

/* Section Headers */
.section-label {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.page-title, .section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-main);
  line-height: 1.2;
}

.page-subtitle, .section-lead {
  max-width: 720px;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ===========================
   Cards & Grid Layouts
   =========================== */
.cards-grid {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.project-card, .portfolio-card, .cert-item {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover, .portfolio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-image {
  text-align: center;
}

.hero-image img {
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Contact Grid */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

/* ===========================
   Footer
   =========================== */
footer {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===========================
   RESPONSIVE - TABLET
   =========================== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   RESPONSIVE - MOBILE
   =========================== */
@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Hide desktop nav, show as mobile menu */
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 5rem 2rem 3rem;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .main-nav.active {
    right: 0;
  }
  
  .main-nav ul {
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
  }
  
  .main-nav li {
    width: 100%;
  }
  
  .main-nav a {
    font-size: 1.1rem;
    padding: 0.5rem 0;
    display: block;
    border-bottom: 2px solid transparent;
  }
  
  .nav-cv-btn {
    width: 100%;
  }
  
  .nav-cv-btn .btn-small {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
  }
  
  /* Overlay when menu is open */
  body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  
  /* Adjust main content padding */
  main {
    padding: 6rem 1.2rem 3rem;
  }
  
  body.admin-bar main {
    padding-top: 7rem;
  }
  
  /* Typography adjustments */
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .page-title {
    font-size: 1.75rem;
  }
  
  .page-subtitle, .section-lead {
    font-size: 1rem;
  }
  
  /* Cards full width on mobile */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }
  
  /* Reduce padding on cards */
  .project-card, .portfolio-card, .cert-item {
    padding: 1.2rem;
  }
  
  /* Nav inner padding */
  .nav-inner {
    padding: 0.75rem 1.2rem;
  }
}

/* ===========================
   RESPONSIVE - SMALL MOBILE
   =========================== */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.75rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  main {
    padding: 5.5rem 1rem 2.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .brand {
    font-size: 1rem;
  }
  
  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
}

/* ===========================
   WORDPRESS ADMIN BAR FIXES
   =========================== */
@media screen and (max-width: 782px) {
  body.admin-bar header {
    top: 46px;
  }
  
  body.admin-bar .main-nav {
    top: 46px;
  }
}

@media screen and (max-width: 600px) {
  body.admin-bar header {
    top: 0;
  }
  
  body.admin-bar .main-nav {
    top: 0;
  }
}

/* ===========================
   Contact Form 7 Styling
   =========================== */
.wpcf7-form {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wpcf7-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 1.25rem;
}

/* Make message field grow to fill space */
.wpcf7-form label:has(.cf7-textarea) {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.wpcf7-form .cf7-input,
.wpcf7-form .cf7-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1F2937;
  background: #FFFFFF;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 0.5rem;
}

.wpcf7-form .cf7-input:focus,
.wpcf7-form .cf7-textarea:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Message textarea grows to fill available space */
.wpcf7-form .cf7-textarea {
  flex: 1;
  min-height: 200px;
  resize: vertical;
}

.wpcf7-form .cf7-submit {
  width: 100%;
  padding: 1rem 2rem;
  background: #3B82F6;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.wpcf7-form .cf7-submit:hover {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.wpcf7-form .cf7-submit:active {
  transform: translateY(0);
}

.wpcf7-form .cf7-note {
  font-size: 0.85rem;
  color: #6B7280;
  margin-top: 1rem;
  text-align: center;
}

/* Remove default CF7 styles */
.wpcf7-form p {
  margin: 0;
}

.wpcf7-form br {
  display: none;
}

/* Validation messages */
.wpcf7-not-valid-tip {
  font-size: 0.8rem;
  color: #EF4444;
  margin-top: 0.25rem;
}

.wpcf7-response-output {
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.wpcf7-mail-sent-ok {
  border: 2px solid #10B981;
  background: #ECFDF5;
  color: #065F46;
}

.wpcf7-validation-errors {
  border: 2px solid #F59E0B;
  background: #FFFBEB;
  color: #92400E;
}

/* ===========================
   About Page Mobile Fix
   =========================== */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr !important;
  }
  
  .fact-list {
    grid-template-columns: 1fr !important;
  }
  
  .wpcf7-form .cf7-textarea {
    min-height: 150px;
  }
}

/* ===========================
   Projects Page Responsive
   =========================== */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===========================
   Utility Classes
   =========================== */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

/* ===========================
   Print Styles
   =========================== */
@media print {
  header, footer, .mobile-menu-toggle {
    display: none;
  }
  
  main {
    padding: 1rem;
  }
}
