/* ===== Decks Page Hero Redesign ===== */

/* Toolbar wrap — aligns to the same 1300px column as the deck grid */
.dk-toolbar-wrap {
  max-width: 1300px;
  margin: 120px auto 0;
  padding: 0 20px;
}

/* Top band: title on the left, search + format on the right */
.dk-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 28px;
  flex-wrap: wrap;
}

.dk-heading { min-width: 0; }

.dk-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.1;
  color: #f4f9ff;
  margin: 0;
}

.dk-count {
  margin: 8px 0 0;
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: rgba(162, 231, 238, 0.72);
}

/* Controls group (search grows, format select hugs the right) */
.dk-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 440px;
  max-width: 640px;
  justify-content: flex-end;
}

/* Search Box */
.dk-search-box {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0 5px 0 14px;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.dk-search-box:focus-within {
  border-color: #22d3ee;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.dk-search-icon {
  width: 16px;
  height: 16px;
  fill: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.dk-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Sora', sans-serif;
  font-size: 0.95rem;
  color: #fff;
  padding: 0;
  min-width: 0;
}

.dk-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.dk-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #0891b2, #22d3ee);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.dk-search-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.3);
}

.dk-search-btn:active {
  transform: scale(0.96);
}

.dk-search-btn svg {
  width: 18px;
  height: 18px;
}

/* Format Filter — inline pill beside the search box */
.dk-filters {
  flex-shrink: 0;
}

.dk-format-select {
  height: 46px;
  padding: 0 34px 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.dk-format-select:hover {
  border-color: rgba(34, 211, 238, 0.5);
  background-color: rgba(255, 255, 255, 0.08);
}

.dk-format-select:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.dk-format-select option {
  background: #0a1929;
  color: #fff;
}

/* Section Header with pagination — divider band beneath the toolbar */
.dk-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dk-section-header h2 {
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

.dk-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dk-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.dk-page-btn:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.12);
  border-color: #22d3ee;
  color: #22d3ee;
}

.dk-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.dk-page-num {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  min-width: 24px;
  text-align: center;
}

/* Hide old pagination at bottom */
.published-decks-container > .pagination {
  display: none;
}

/* Override old styles that conflict */
.big-wrapper,
.search-title,
.search-box,
.search-box-wrapper,
.search-box::before,
.deck-filter-container {
  display: none !important;
}

/* Loader */
.loading-spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #22d3ee;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  animation: dk-spin 0.7s linear infinite;
  margin: 40px auto;
}

@keyframes dk-spin {
  to { transform: rotate(360deg); }
}

.published-decks-container {
    max-width: 1300px;
    margin: auto;
    padding: 20px;
}

.deck-item {
display: flex;
    align-items: center;
    border: 1px solid #a2e7ee;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 2px 3px 7px -1px #3498db;
    width: 100%;
    max-width: 325px;
    min-width: 300px;
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
    position: relative;
    min-height: 225px;
}

/* Ensure that the other elements inside .deck-item are above the background image */
.deck-info, .deck-mana-bar {
    position: relative;
    z-index: 1;
}

.deck-item:hover {
    transform: translateY(-5px); /* slightly lift the deck */
    box-shadow: 0 4px 8px #3498db; /* subtle shadow */
}

.deck-image {
    width: 120px; /* Adjust as needed */
    height: auto;
    border-right: 1px solid #ddd;
}

.deck-info {
    padding: 10px;
    flex-grow: 1;
    text-align: center;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.deck-name {
    font-size: 1.2em;
    margin: 0;
    font-weight: bold;
    background-image: linear-gradient(135deg, #a2e7ee 0%, #a2e7ee 33.33%, #3498db 66.67%, #4196e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.deck-format, .deck-created {
    font-size: 0.9em;
    color: #fff;
    margin: 0px;
}

/* Container for the mana bar */
.deck-mana-bar {
    display: flex; /* Aligns child divs horizontally */
    height: 30px; /* Set the height of the mana bar */
    border-radius: 10px; /* Optional: Rounds the corners of the bar */
    overflow: hidden; /* Ensures that children divs do not overflow the rounded corners */
    margin-top: 20px;
}

/* Individual segments within the mana bar */
.mana-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white; /* Color of the text inside each segment */
    font-weight: bold; /* Make the text inside each segment bold */
    font-size: 0.75rem; /* Adjust the font size as needed */
    transition: width 0.3s ease; /* Smooth transition for the width change */
        background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
    position: relative; /* To position the icon inside the bar */
    min-width: 25px;
}

.view-deck-button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}


.mana-bar-W {
    background-image: url('/images/W.png');
    background-position: center;
}

.mana-bar-U {
    background-image: url('/images/U.png');
    background-position: center;

}

.mana-bar-B {
    background-image: url('/images/B.png');
    background-position: center;
}

.mana-bar-R {
    background-image: url('/images/R.png');
    background-position: center;
}

.mana-bar-G {
    background-image: url('/images/G.png');
    background-position: center;

}

.decks-list {
    display: grid;
    grid-gap: 25px; /* This is shorthand for row-gap and column-gap */
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); /* Adjust min value to your minimum card width */
    justify-content: center; /* This will center the grid items in the grid container if they don't take up full width */
        max-width: 1300px;
    margin: auto;
}

.clickable {
    cursor: pointer;
}

.clickable:hover {
    /* Add any hover effects you like, such as a background color change */
}



.deck-background-image {
    background-size: cover;
    background-position: top;
    opacity: 0.6;
    width: 125%;
    height: 170%;
    position: absolute;
    top: 0;
    left: -45px;
    z-index: -1;
    
}



.deck-background-image::after {
content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #05051e6b, #012a4a);
}


.deck-interaction {
    display: flex;
    position: absolute; /* Position the interaction container absolutely */
    top: 10px; /* Adjust as needed for spacing from the top */
    right: 10px; /* Adjust as needed for spacing from the right */
    align-items: center;
}

.deck-views, .deck-heart {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px; /* Add spacing between the view and heart elements */
    cursor: pointer;
    font-size: 0.9em;
    color: #fff; /* Adjust the color to fit your theme */
}

.view-icon, .heart-icon {
    margin-right: 5px;
}

.heart-icon {
    color: #fff; /* Adjust the color for your heart icon */
}

/* Optional: Add hover effect for icons */
.deck-views:hover, .deck-heart:hover {
    opacity: 0.8;
}
.deck-display-name {
    position: absolute; /* Position the display name absolutely */
    top: 10px; /* Adjust as needed for spacing from the top */
    left: 10px; /* Adjust as needed for spacing from the left */
    font-size: .9em; /* Adjust the font size as needed */
    color: #fff; /* Adjust the color to fit your theme */
    z-index: 1; /* Ensure the display name is above other elements */
}



.loading-spinner {
    border: 5px solid #f3f3f3; /* Light grey */
    border-top: 5px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.deck-item {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.deck-item.visible {
    opacity: 1;
}


@media (max-width: 600px) {
.decks-list {
    grid-template-columns: repeat(1,1fr);
    width: 100%;
}

/* Match the card column to the toolbar/search width above (16px gutters),
   and let each card fill the column instead of being capped at 325px.
   width:100% + border-box is REQUIRED: <body> is a flex column that sizes
   this container to its content, and every .deck-item child is absolutely
   positioned (zero in-flow width). Without an explicit width the whole
   chain (container → grid → card) collapses to ~0 and the cards vanish —
   the old min-width:300px on .deck-item was the only thing feeding width
   up that chain. box-sizing:border-box keeps padding from overflowing
   (the site has no global border-box reset). */
.published-decks-container {
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
}

.deck-item {
    max-width: none;
    min-width: 0;
    width: 100%;
}
}













/* Style for the profile image and view profile button */
.profile-image-wrapper {
    display: inline-block;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100px;
    height: 100px;
    margin: 10px auto; /* Center the image and add margin */
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.view-profile-button {
    display: block;
    text-align: center;
    margin: 10px auto;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.view-profile-button:hover {
    background-color: #2980b9;
}

/* Style for each user card */
.user-card {
    text-align: center;
    color: white; /* Adjust color as needed */
}

/* Wrapper for profile image to create circle and shadow effect */
.user-card .profile-image-wrapper {
    display: inline-block;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 100px; /* Adjust size as needed */
    height: 100px; /* Adjust size as needed */
    margin: 0 auto 10px; /* Center the image and add bottom margin */
}

/* Style for the profile image */
.user-card .profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Style for the user info */
.user-info {
    text-align: center;
}

.user-info h3 {
    margin: 10px 0 5px;
    font-size: 1.2em;
    white-space: nowrap; /* Prevent text wrap */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis for long names */
}

.user-info p {
    margin: 0;
    font-size: 1em;
}

/* Style for the sub copy */
.sub-copy {
    text-align: center;
    margin-top: 20px;
    color: white;
}

.sub-copy a {
    color: #a2e7ee;
    text-decoration: underline;
}

.sub-copy a:hover {
    text-decoration: underline;
}

/* Responsive design adjustments */
@media (max-width: 600px) {
    #usersWrapper {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-card:nth-child(5) {
        grid-column: span 2;
        justify-self: center;
    }
}

/* Aligning user cards evenly */
@media (min-width: 601px) and (max-width: 1024px) {
    #usersWrapper {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1025px) {
    #usersWrapper {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Decks toolbar responsive */
@media (max-width: 768px) {
  .dk-toolbar-wrap {
    margin-top: 100px;
    padding: 0 16px;
  }

  /* Stack: title on top, full-width controls beneath */
  .dk-toolbar {
    align-items: stretch;
    gap: 14px;
  }

  .dk-controls {
    flex: 1 1 100%;
    max-width: none;
    justify-content: stretch;
  }
}

@media (max-width: 480px) {
  /* Very narrow: search on its own row, format filter full-width below it */
  .dk-controls {
    flex-wrap: wrap;
  }

  .dk-search-box {
    flex: 1 1 100%;
  }

  .dk-filters {
    flex: 1 1 100%;
  }

  .dk-format-select {
    width: 100%;
  }
}
