/* ==========================================
   MODERN PORTFOLIO DESIGN - 2024/2025
   Dark Mode Support | Glassmorphism | Animations
   ========================================== */

/* CSS Variables for Light/Dark Theme */
:root {
  /* Light Mode Colors */
  --primary-color: #6366f1;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-color: #8b5cf6;
  --accent-color: #ec4899;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: rgba(148, 163, 184, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 12px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
  --backdrop-blur: blur(10px);

  /* Skill Colors */
  --skill-csharp: #239120;
  --skill-python: #3776ab;
  --skill-php: #777bb4;
  --skill-js: #f7df1e;
  --skill-html: #e34f26;
  --skill-css: #1572b6;
}

[data-theme="dark"] {
  /* Dark Mode Colors */
  --primary-color: #818cf8;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-color: #a78bfa;
  --accent-color: #f472b6;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.9);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3), 0 6px 12px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Smooth Transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Body Styling */
body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Override W3.CSS classes for dark mode */
[data-theme="dark"] .w3-light-grey,
[data-theme="dark"] body.w3-light-grey {
  background: var(--bg-primary) !important;
}

[data-theme="dark"] .w3-white {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .w3-container {
  color: var(--text-primary) !important;
}

/* Dark mode for HR and borders */
[data-theme="dark"] hr {
  border-color: var(--border-color) !important;
  opacity: 0.3;
}

/* Dark mode for headings and text */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .w3-text-grey {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .w3-text-black {
  color: var(--text-primary) !important;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Modern Navbar with Glassmorphism */
.navbar {
  background: var(--bg-card) !important;
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: var(--shadow-lg);
}

/* Override Bootstrap navbar classes for dark mode */
[data-theme="dark"] .navbar.bg-black,
[data-theme="dark"] .navbar-dark {
  background: var(--bg-card) !important;
}

[data-theme="dark"] .navbar-toggler-icon {
  filter: brightness(1.5);
}

/* Dropdown Menu Dark Mode */
[data-theme="dark"] .dropdown-menu {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--bg-card) !important;
  color: var(--primary-color) !important;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  color: var(--text-primary) !important;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 1rem !important;
  transition: all 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

/* Dark Mode Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.theme-toggle i {
  font-size: 1.2rem;
  color: var(--primary-color);
}

/* Welcome Message */
.navbar-message {
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 50%, #4c1d95 100%);
  padding: 2rem 0;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Subtle pattern overlay for depth */
.navbar-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.navbar-message h1 {
  color: white;
  font-weight: 700;
  font-size: 2.5rem;
  margin: 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

/* Modern Card Styling */
.w3-card,
.w3-card-4 {
  background: var(--bg-card) !important;
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: 16px !important;
  overflow: hidden;
  transition: all 0.3s ease;
}

.w3-card:hover,
.w3-card-4:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl) !important;
}

/* Profile Image */
.w3-display-container img {
  border-radius: 16px 16px 0 0;
  transition: all 0.3s ease;
  filter: brightness(0.9);
}

.w3-display-container:hover img {
  filter: brightness(1) saturate(1.1);
  transform: scale(1.02);
}

.w3-display-bottomleft h2 {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  font-weight: 700;
}

/* Text Colors */
.w3-text-grey,
.w3-text-black {
  color: var(--text-primary) !important;
}

.w3-opacity {
  opacity: 1;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .w3-opacity {
  color: var(--text-secondary) !important;
}

/* Modern Skills Section */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.skill-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-block;
}

.skill-percentage {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.skill-progress {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.skill-progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 10px;
  transition: width 1s ease;
  position: relative;
  overflow: hidden;
}

.skill-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Language Progress Bars - Modern Style */
.language-item {
  margin-bottom: 1rem;
}

.language-item p {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.w3-light-grey {
  background-color: var(--border-color) !important;
}

.w3-black,
.w3-round-xlarge {
  background: var(--primary-gradient) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Work Experience & Education Section */
.experience-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 2rem;
  border-left: 3px solid var(--primary-color);
}

.experience-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  width: 14px;
  height: 14px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-card);
}

.experience-item h3 {
  color: var(--text-primary);
  font-weight: 700;
}

.experience-item h5 {
  color: var(--primary-color);
  font-weight: 600;
}

.w3-tag {
  background: var(--primary-gradient) !important;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  color: white !important;
}

/* Dark mode specific overrides */
[data-theme="dark"] .w3-tag.w3-black {
  background: var(--primary-gradient) !important;
}

[data-theme="dark"] .w3-display-bottomleft h2 {
  color: white !important;
}

/* Dark mode icons */
[data-theme="dark"] .fa {
  color: var(--text-primary);
}

[data-theme="dark"] i.w3-text-black,
[data-theme="dark"] .w3-text-black i {
  color: var(--primary-color) !important;
}

/* Dark mode content wrapper */
[data-theme="dark"] .w3-content {
  color: var(--text-primary);
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.portfolio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.portfolio-card:hover::before {
  transform: scaleX(1);
}

.portfolio-image {
  width: 100%;
  height: 200px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.portfolio-content {
  padding: 1.5rem;
}

.portfolio-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.portfolio-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.portfolio-link:hover {
  gap: 0.75rem;
  color: var(--secondary-color);
}

/* Scroll to Top Button */
#myBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background: var(--primary-gradient);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  font-size: 20px;
  width: 50px;
  height: 50px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  display: none;
}

#myBtn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: var(--shadow-xl);
}

/* Footer - Modern Design */
footer {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  margin-top: 4rem !important;
  color: white !important;
  padding: 2.5rem 1rem 1.5rem !important;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay */
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-gradient);
  opacity: 0.6;
}

footer p {
  color: rgba(255, 255, 255, 0.9) !important;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

footer.w3-black,
footer.w3-container {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  color: white !important;
}

/* Social Icons Container */
footer .social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Social Media Icons - Modern Style */
footer .social-icons a {
  color: white !important;
  font-size: 1.4rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1;
  text-decoration: none;
}

footer .social-icons a i {
  position: relative;
  z-index: 2;
  color: white !important;
}

footer .social-icons a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: var(--primary-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

footer .social-icons a:hover {
  color: white !important;
  transform: translateY(-5px) scale(1.1);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

footer .social-icons a:hover::before {
  opacity: 1;
}

/* Instagram specific hover */
footer .social-icons a:has(.fa-instagram):hover {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  color: white !important;
}

/* Twitter/X specific hover */
footer .social-icons a:has(.fa-twitter):hover {
  background: #1DA1F2;
  color: white !important;
}

/* LinkedIn specific hover */
footer .social-icons a:has(.fa-linkedin):hover {
  background: #0077b5;
  color: white !important;
}

/* Contact Button - Modern */
footer button {
  background: var(--primary-gradient) !important;
  border: none !important;
  padding: 0.75rem 2rem !important;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: white !important;
  border-radius: 25px !important;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  position: relative;
  overflow: hidden;
}

footer button::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;
}

footer button:hover::before {
  left: 100%;
}

footer button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

footer .w3-small {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Footer Content Layout */
footer > p:first-of-type {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Modal Styling */
.w3-modal-content {
  background: var(--bg-card) !important;
  border-radius: 16px !important;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl) !important;
}

.w3-modal-content header {
  background: var(--primary-gradient) !important;
  border-radius: 16px 16px 0 0 !important;
}

/* Dark mode modal background */
[data-theme="dark"] .w3-modal {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .w3-modal-content {
  background: var(--bg-secondary) !important;
}

/* Form Styling */
input[type="text"],
input[type="email"],
textarea {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

label {
  color: var(--text-primary) !important;
  font-weight: 500;
}

/* Error messages */
.error-message {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 3px solid #ef4444;
}

[data-theme="dark"] button[type="submit"] {
  background: var(--primary-gradient) !important;
  color: white !important;
}

/* Animations */
.animate-on-scroll {
  opacity: 0;
}

.fade-in {
  animation: fadeIn 0.6s ease-in forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar-message h1 {
    font-size: 1.8rem;
  }

  .skills-container {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
    padding: 0.4rem 0.8rem;
  }
}

/* Print Styling */
@media print {
  .theme-toggle,
  #myBtn,
  .navbar {
    display: none !important;
  }
}

/* Background Pattern (Optional) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}
