:root {
  --card-size: 280px;
}

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(to top, #ffdde1 0%, #ffc7d1 100%);
  color: #555;
  min-height: 100vh;
}

body.modal-open {
    overflow: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
}

.header h1 {
  font-size: 3rem;
  color: #fff;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.1);
  font-weight: 700;
}

.language-switcher {
    position: absolute;
    top: 10px;
    right: 0;
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.5);
  color: #e6a5b5;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.lang-btn:hover, .lang-btn.active {
  background: #fff;
  color: #ffdde1;
}

.controls {
  margin: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

#add-guide-btn, .filter-btn {
  background: #fff;
  color: #d19ca9;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

#add-guide-btn:hover, .filter-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.filter-btn.active {
    background: #ffc7d1;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 199, 209, 0.4);
}

.pokedex-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--card-size), 1fr));
  gap: 1.5rem;
}

.pokemon-card {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.pokemon-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.card-actions-corner {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pokemon-card:hover .card-actions-corner {
    opacity: 1;
}

.card-action-btn {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid #eee;
    width: calc(var(--card-size) * 0.12);
    height: calc(var(--card-size) * 0.12);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: calc(var(--card-size) * 0.05);
    color: #aaa;
    z-index: 5;
}

.card-action-btn:hover {
    background: #fff;
    color: #888;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.card-header img {
  width: calc(var(--card-size) * 0.28);
  height: calc(var(--card-size) * 0.28);
  object-fit: contain;
  background: #fff5f7;
  border-radius: 15px;
  padding: 5px;
}

.card-header h2 {
  font-size: calc(var(--card-size) * 0.06);
  color: #b38a9a;
  font-weight: 700;
}

.card-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem 1.5rem;
  align-items: center;
}

.card-details p {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: calc(var(--card-size) * 0.038);
  color: #888;
}

.card-details p strong {
  color: #d19ca9;
  font-weight: 600;
}

.card-details .detail-value {
  font-weight: 600;
  color: #777;
}

.collection-stars .star {
    font-size: calc(var(--card-size) * 0.055);
    color: #ffdde1;
    cursor: pointer;
    transition: color 0.2s;
}

.collection-stars .star.filled {
    color: #ffd055;
}


/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  animation: fadeIn 0.3s;
  max-height: 80vh;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

#details-modal-content {
    padding: 0;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #ccc;
  font-size: 35px;
  font-weight: bold;
  transition: color 0.3s ease;
  z-index: 10;
}

.close-btn:hover,
.close-btn:focus {
  color: #ffc7d1;
  text-decoration: none;
  cursor: pointer;
}

#guide-details-header {
    background: linear-gradient(to top, #ffdde1 0%, #ffc7d1 100%);
    padding: 2rem;
    text-align: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

#guide-details-header img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 10px;
    margin-bottom: 1rem;
}

#guide-details-header h2 {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

#guide-details-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

#guide-details-body p {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    color: #555;
}

#guide-details-body p strong {
    display: block;
    color: #d19ca9;
    margin-bottom: 0.5rem;
}

#guide-details-body .collection-stars:hover .star {
    color: #ffd972;
}

#guide-details-body .collection-stars .star:hover ~ .star {
    color: #ffdde1;
}


#details-modal-actions {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 0.8rem;
}

.modal-action-btn {
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #b38a9a;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.modal-action-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

/* Form Styles */
#add-guide-form {
    padding: 2.5rem;
}

#add-guide-modal .modal-content {
    overflow-y: initial;
    padding: 0;
}

#add-guide-form input, #add-guide-form select {
  width: 100%;
  padding: 12px;
  margin-bottom: 1rem;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #f9f9f9;
  color: #555;
  font-family: 'Nunito', sans-serif;
  transition: all 0.3s ease;
}

#add-guide-form input:focus, #add-guide-form select:focus {
    outline: none;
    border-color: #ffc7d1;
    background: #fff;
}

#image-drop-zone {
  border: 2px dashed #e0e0e0;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
  color: #bbb;
  transition: border-color 0.3s ease, color 0.3s ease;
}
#image-drop-zone:hover {
    border-color: #ffc7d1;
    color: #ffc7d1;
}

#add-guide-form button {
  width: 100%;
  background: linear-gradient(to right, #ffc7d1, #ffdde1);
  color: white;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  font-weight: 600;
}

#add-guide-form button:hover {
    opacity: 0.9;
    box-shadow: 0 5px 15px rgba(255, 199, 209, 0.5);
}

.size-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  outline: none;
  transition: opacity 0.2s;
}

#size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#size-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
    }

    .filters {
        order: 2;
    }

    .size-controls {
        order: 1;
        margin-left: 0;
        margin-bottom: 1rem;
    }

    #add-guide-btn {
        order: 3;
    }
}
