/* Base styles */
body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #0f0f0f, #1a1a1a);
  color: #ffffff;
  margin: 0;
  overflow-x: hidden;
  transition: background 0.5s ease;
  cursor: none !important; /* Force hide default cursor */
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #121212;
}

::-webkit-scrollbar-thumb {
  background: #00ff7f;
  border-radius: 4px;
}

/* Accent color and text styles */
a {
  text-decoration: none;
  font-weight: bold;
  color: inherit;
  transition: all 0.3s ease;
  cursor: none !important; /* Ensure links don't show default cursor */
}

.accent-text {
  color: #00ff7f;
  text-shadow: 0 0 10px rgba(0, 255, 127, 0.5);
}

/* Navbar styling */
.navbar {
  background: rgba(13, 13, 13, 0.95) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar-dark .navbar-brand, .navbar-dark .nav-link {
  color: #ffffff;
  transition: all 0.3s ease;
}

.navbar-dark .navbar-brand:hover {
  color: #00ff7f;
  transform: translateY(-2px);
}

.navbar-dark .nav-link {
  position: relative;
  margin: 0 10px;
}

.navbar-dark .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background: #00ff7f;
  transition: width 0.3s ease;
}

.navbar-dark .nav-link:hover {
  color: #00ff7f;
}

.navbar-dark .nav-link:hover::after,
.navbar-dark .nav-link.active::after {
  width: 100%;
}

.navbar-dark .nav-link.active {
  color: #00ff7f;
}

/* Profile section styling */
.profile-pic-container {
  display: inline-block;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #00ff7f;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 255, 127, 0.5);
  transition: all 0.5s ease;
  margin: 0 auto;
}

.profile-info {
  margin-top: 1rem;
}

.profile-info h3 {
  margin-bottom: 0.5rem;
}

.profile-pic-container:hover {
  transform: scale(1.05);
  border-color: #fff;
  box-shadow: 0 0 40px rgba(0, 255, 127, 0.8);
}

.profile-pic-container::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 255, 127, 0.2) 0%, rgba(0, 255, 127, 0) 70%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.profile-pic-container:hover::after {
  opacity: 1;
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

/* Card and section styling */
.row iframe {
  background-color: #c1ccc2;
}

section {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

h1, h2, h3, h4 {
  color: #00ff7f;
  font-weight: 700;
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 50px;
  height: 3px;
  background: #00ff7f;
  border-radius: 5px;
  transition: width 0.3s ease;
}

h2:hover::after {
  width: 100%;
}

#typewriter {
  font-weight: bold;
  font-size: 1.1rem;
  color: #a7b5c2;
  display: block;
  margin-top: 10px;
  min-height: 1.5rem;
}

.card {
  background: rgba(30, 30, 30, 0.6);
  border: none;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: all 0.4s ease;
  position: relative;
  opacity: 0;
  transform: translateY(40px);
  animation: cardReveal 0.8s forwards;
  animation-delay: calc(var(--card-index) * 0.1s);
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00ff7f, transparent);
  transform: scaleX(0);
  transition: transform 0.5s ease;
  transform-origin: left;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  
}

.card:hover::before {
  transform: scaleX(1);
}

.row.certifications {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(30, 30, 30, 0.6);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.row.certifications h2 {
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
}

.row.certifications > div {
  margin: 1rem;
  transition: transform 0.3s ease;
}

.row.certifications > div:hover {
  transform: translateY(-5px);
}

.card-body {
  color: #ffffff;
  padding: 1.5rem;
}

/* Button styling */
a.btn-outline-light, button.btn-outline-light {
  border-color: #00ff7f;
  color: #00ff7f;
  border-radius: 30px;
  padding: 8px 20px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.4s ease;
  cursor: none !important; /* Ensure buttons don't show default cursor */
}

a.btn-outline-light::before, button.btn-outline-light::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: #00ff7f;
  z-index: -1;
  transition: left 0.4s ease;
}

a.btn-outline-light:hover, button.btn-outline-light:hover {
  color: #121212;
  border-color: #00ff7f;
  box-shadow: 0 0 15px rgba(0, 255, 127, 0.5);
}

a.btn-outline-light:hover::before, button.btn-outline-light:hover::before {
  left: 0;
}

/* Skills and projects styling */
#skills ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 0;
  list-style-type: none;
}

#skills ul li img {
  height: 30px;
  width: auto;
  margin: 5px;
  transition: all 0.3s ease;
  filter: grayscale(30%);
  position: relative;
}

#skills ul li img:hover {
  transform: translateY(-5px) scale(1.1);
  filter: grayscale(0%);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.image-container {
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  position: relative;
}

.image-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(28,28,28,1) 100%);
}

.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img-top {
  transform: scale(1.1);
}

/* Project card hover effects */
#projects .card {
  overflow: hidden;
}

#projects .card-title {
  position: relative;
  display: inline-block;
}

#projects .card-title::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #00ff7f;
  transition: width 0.3s ease;
}

#projects .card:hover .card-title::after {
  width: 100%;
}

/* Form styling */
form {
  background: rgba(35, 35, 35, 0.7);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  transition: all 0.4s ease;
  cursor: none !important;
}

form:hover {
  background: rgba(40, 40, 40, 0.8);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  cursor: none !important;
}

.form-control {
  background-color: rgba(20, 20, 20, 0.7);
  border: 1px solid #333;
  color: #fff;
  border-radius: 8px;
  padding: 12px;
  transition: all 0.3s ease;
  transform: translateX(-20px);
  opacity: 0;
  animation: slideIn 0.5s forwards;
}

@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.form-control:focus {
  background-color: rgba(30, 30, 30, 0.9);
  border-color: #00ff7f;
  box-shadow: 0 0 0 0.25rem rgba(0, 255, 127, 0.25);
  color: #fff;
}

.form-label {
  display: block;
  transform: translateY(20px);
  opacity: 0;
  animation: fadeDown 0.5s forwards;
  cursor: none !important;
}

@keyframes fadeDown {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Staggered animations for form elements */
#contact .form-label:nth-child(1) {
  animation-delay: 0.1s;
}

#contact .form-control:nth-child(2) {
  animation-delay: 0.2s;
}

#contact .form-label:nth-child(3) {
  animation-delay: 0.3s;
}

#contact .form-control:nth-child(4) {
  animation-delay: 0.4s;
}

#contact .form-label:nth-child(5) {
  animation-delay: 0.5s;
}

#contact .form-control:nth-child(6) {
  animation-delay: 0.6s;
}

#contact button[type="submit"] {
  animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 127, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 255, 127, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 127, 0);
  }
}

/* Footer styling */
footer {
  background: linear-gradient(to top, #131313, #1c1c1c);
  padding: 1rem 0;
  position: relative;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer .social-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

footer .social-icons p {
  color: #888;
  margin-bottom: 0.5rem;
}

footer .btn {
  padding: 0.5rem 1rem;
  min-width: 120px;
}

#back-to-top {
  min-width: auto;
  padding: 0.5rem;
  margin-right: 2rem;
}

footer a.btn-outline-light {
  border-color: #00ff7f;
  color: #00ff7f;
}

footer a.btn-outline-light:hover {
  background-color: #00ff7f;
  color: #121212;
}

@media (max-width: 768px) {
  footer .d-flex {
    flex-direction: column;
    gap: 1rem;
  }
  
  #back-to-top {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  footer .social-icons {
    width: 100%;
  }
  
  footer .btn {
    min-width: auto;
    margin-bottom: 0.5rem;
  }
}

/* Back to top button - IMPROVED FIXED POSITION */
.btn-back-to-top {
  position: center;
  bottom: 2rem; /* Moved up */
  right: -4.5rem;
  width: 40px; /* Slightly smaller */
  height: 40px; /* Slightly smaller */
  border-radius: 50%;
  background-color: rgba(20, 20, 20, 0.9); /* More opaque */
  border: 2px solid #00ff7f;
  color: #00ff7f;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 1100; /* Increased z-index to ensure visibility */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  animation: pulse 2s infinite;
  cursor: none !important; /* Ensure button doesn't show default cursor */
}

.btn-back-to-top:hover {
  background-color: rgba(0, 255, 127, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 255, 127, 0.3);
}

.btn-back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.btn-back-to-top i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.btn-back-to-top:hover i {
  transform: translateY(-3px);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 127, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 255, 127, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 127, 0);
  }
}

/* Cursor effects - IMPROVED FOR LINKS */
.custom-cursor {
  position: fixed;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 255, 127, 0.6);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s, background-color 0.3s;
  z-index: 9999;
  mix-blend-mode: exclusion;
}

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background-color: rgba(0, 255, 127, 0.8);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10000;
  transition: transform 0.15s, width 0.3s, height 0.3s, background-color 0.3s;
}

/* Updated cursor hover states for links */
a:hover ~ .custom-cursor,
button:hover ~ .custom-cursor,
.nav-link:hover ~ .custom-cursor,
.navbar-brand:hover ~ .custom-cursor,
.btn:hover ~ .custom-cursor {
  width: 50px;
  height: 50px;
  border-color: rgba(0, 255, 127, 0.3);
  background-color: rgba(0, 255, 127, 0.1);
  mix-blend-mode: normal;
}

a:hover ~ .cursor-dot,
button:hover ~ .cursor-dot,
.nav-link:hover ~ .cursor-dot,
.navbar-brand:hover ~ .cursor-dot,
.btn:hover ~ .cursor-dot {
  width: 4px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .profile-pic-container {
    width: 120px;
    height: 120px;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .image-container {
    height: 200px;
  }
  
  footer {
    padding: 0.8rem 0 0.3rem; /* Even more reduced for mobile */
  }
  
  .btn-back-to-top {
    bottom: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
  }
}

/* Enhanced link for Zaachila Radio */
#about a[href="http://www.zaachilaradio.com"] {
  position: relative;
  color: #00ff7f;
  font-weight: bold;
  padding: 2px 5px;
  text-decoration: none;
  transition: all 0.3s ease;
  background: linear-gradient(90deg, rgba(0, 255, 127, 0.1), transparent);
  border-radius: 4px;
}

#about a[href="http://www.zaachilaradio.com"]:hover {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(0, 255, 127, 0.3), rgba(0, 255, 127, 0.1));
  text-shadow: 0 0 8px rgba(0, 255, 127, 0.8);
  transform: translateY(-2px);
}

#about a[href="http://www.zaachilaradio.com"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #00ff7f;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

#about a[href="http://www.zaachilaradio.com"]:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Other effects */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.07;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #121212;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-spinner {
  width: 100px;
  height: 100px;
  border: 5px solid transparent;
  border-top-color: #00ff7f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* Footer wave styles */
.footer-wave {
  display: block;
  width: 30%;
  margin-top: -50px; /* Reduced margin */
  margin-bottom: -5px;
  position: relative;
  z-index: -1;
}

/* Gravatar Card Styles */
.gravatar-card {
  background: #1a1a1a;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.gravatar-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.gravatar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-right: 15px;
}

.gravatar-info h4 {
  margin: 0;
  color: #fff;
}

.gravatar-info p {
  margin: 5px 0;
  color: #888;
}

.gravatar-body {
  margin-bottom: 20px;
  color: #ddd;
}

.gravatar-social {
  display: flex;
  gap: 15px;
}

.gravatar-social a {
  color: #fff;
  font-size: 20px;
  transition: color 0.3s ease;
}

.gravatar-social a:hover {
  color: #007bff;
}

/* Certificates Container */
.certificates-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  width: 100%;
}

.certificate-card {
  aspect-ratio: 1;
  min-height: 250px;
  position: relative;
  transition: all 0.3s ease;
  border-radius: 15px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.6);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  cursor: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certificate-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.certificate-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.certificate-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 255, 127, 0.2);
}

.certificate-card:hover .certificate-img {
  transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .certificates-container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .certificates-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .certificate-card {
    min-height: 200px;
  }

  .profile-pic-container {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .certificates-container {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin: 0 auto;
  }

  .certificate-card {
    min-height: 180px;
  }
}

/* Footer styles */
footer {
  background: linear-gradient(to top, #131313, #1c1c1c);
  padding: 1rem 0;
  position: relative;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer .social-icons {
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer .social-icons .d-flex {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

footer .btn {
  white-space: nowrap;
  padding: 0.5rem 1rem;
}

#back-to-top {
  padding: 0.5rem;
  margin-right: 2rem;
}

@media (max-width: 768px) {
  .certificates-container {
    flex-direction: column;
    height: auto;
  }

  .certificate-card {
    height: 100px;
    width: 100%;
  }

  .certificate-card:hover {
    height: 300px;
  }

  footer .social-icons .d-flex {
    flex-direction: column;
    align-items: center;
  }

  #back-to-top {
    margin-right: 0;
    margin-bottom: 1rem;
  }
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Project card styles */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
}

.card-link:hover {
  transform: translateY(-5px);
  color: inherit;
}

.card-link:hover .card {
  box-shadow: 0 8px 16px rgba(0, 255, 127, 0.2);
}

.card-link .card {
  transition: all 0.3s ease;
}

/* Footer styles */
footer {
  background: linear-gradient(to top, #131313, #1c1c1c);
  padding: 1rem 0;
  position: relative;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 992px) {
  .social-links {
    flex-direction: row;
    align-items: center;
  }
}

#back-to-top {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 1rem;
}

/* Credly dark theme */
.certificate-card {
  background: #1a1a1a;
}

.certificate-content iframe {
  filter: invert(1) hue-rotate(180deg);
}

@media (max-width: 768px) {
  .social-links {
    gap: 10px;
  }
  
  footer .btn {
    width: 100%;
  }
  
  #back-to-top {
    margin: 0 auto 1rem;
  }
}

/* Ensure hamburger menu (navbar toggler) uses hidden system cursor */
.navbar-toggler,
.navbar-toggler:focus,
.navbar-toggler:hover,
.navbar-toggler .navbar-toggler-icon {
  cursor: none !important;
}

/* Hide cursor on contact form controls */
#contact input.form-control,
#contact textarea.form-control,
#contact select.form-control,
#contact .form-control,
#contact input,
#contact textarea,
#contact select {
  cursor: none !important;
}

#contact input.form-control:hover,
#contact input.form-control:focus,
#contact textarea.form-control:hover,
#contact textarea.form-control:focus,
#contact select.form-control:hover,
#contact select.form-control:focus,
#contact .form-control:hover,
#contact .form-control:focus,
#contact input:hover,
#contact input:focus,
#contact textarea:hover,
#contact textarea:focus,
#contact select:hover,
#contact select:focus {
  cursor: none !important;
}