/* Stats Header */
.stats-header {
    background: rgba(52, 40, 44, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 49, 49, 0.6);
    border-radius: 8px;
    border-left: 3px solid #d4af37;
}

.stat-box i {
    font-size: 1.5rem;
    color: #d4af37;
}

.stat-value {
    display: block;
    font-weight: bold;
    font-size: 1.2rem;
    color: #f8d49a;
}

.stat-value.active {
    color: #7fb685;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Live Sessions */
.live-sessions {
    margin-top: 3rem;
}

.sessions-slider-container {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.sessions-slider-track {
    display: flex;
    gap: 1.5rem;
    animation: scroll-loop 40s linear infinite;
    will-change: transform;
}


@keyframes scroll-loop {
    0%   { transform: translateX(0); }
    100% { transform: translateX(var(--scroll-width)); }
}


.session-card {
    flex: 0 0 auto;
    min-width: 250px; /* You can adjust this width */
}


.session-card {
    background: rgba(52, 40, 44, 0.8);
    border-radius: 10px;
    padding: 1.5rem;
    min-width: 260px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.session-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.session-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #d4af37, #f8d49a);
}

.session-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.session-status {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.8rem;
}

.session-status.active {
    background: rgba(127, 182, 133, 0.2);
    color: #7fb685;
}

.session-status.starting {
    background: rgba(248, 212, 154, 0.2);
    color: #f8d49a;
}

.session-status.waiting {
    background: rgba(66, 135, 245, 0.2);
    color: #4287f5;
}

.session-players {
    color: #f0f0f0;
}

.session-title {
    font-family: 'MedievalSharp', cursive;
    color: #d4af37;
    margin: 0.5rem 0 1rem;
    font-size: 1.3rem;
}

.session-details {
    margin: 1rem 0;
    font-size: 0.9rem;
}

.session-details p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-details i {
    width: 20px;
    color: #d4af37;
}

.session-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag {
    background: rgba(212, 175, 55, 0.1);
    color: #f8d49a;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.session-join {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}


.modal-content {
    background: #34282C;
    border-radius: 10px;
    height: 100%;
    max-height: 900px;
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
    border: 1px solid #d4af37;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: #f0f0f0;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #d4af37;
}

.modal-content h2 {
    font-family: 'MedievalSharp', cursive;
    color: #d4af37;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #f0f0f0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.session-form input,
.session-form select,
.session-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    background: rgba(59, 49, 49, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #f0f0f0;
    font-family: 'Roboto', sans-serif;
}

.session-form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-option {
    background: rgba(59, 49, 49, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-option input {
    width: auto;
    margin-right: 0.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Animations */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-280px * 5 - 1.5rem * 4));
    }
}

/* Responsive */
@media (max-width: 768px) {
    .stats-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .session-card {
        min-width: 240px;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

.error-message {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(255, 107, 107, 0.1);
    display: none;
    align-items: center;
    gap: 6px;
}

.error-message.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.error-message i {
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}


.join-session-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.join-session-box {
    background: #34282C;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
    border: 1px solid #d4af37;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.join-session-box h3 {
    font-family: 'MedievalSharp', cursive;
    color: #d4af37;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#join-session-code {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    background: rgba(59, 49, 49, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #f0f0f0;
    font-family: 'Roboto', sans-serif;
}

.button-row {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

#cancel-join,
#submit-join {
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#cancel-join {
    background: transparent;
    border: 2px solid #d4af37;
    color: #d4af37;
}

#cancel-join:hover {
    background: rgba(212, 175, 55, 0.1);
}

#submit-join {
    background: linear-gradient(to right, #d4af37, #f8d49a);
    border: none;
    color: #34282C;
}

#submit-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

@media (max-width: 768px) {
    .join-session-box {
        width: 95%;
        padding: 1.5rem;
    }
}

.session-description {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: #dcdcdc;
  font-size: 0.9rem;
  line-height: 1.4rem;
}

.session-description .desc-label {
  font-weight: bold;
  color: var(--accent);
  display: block;
  margin-bottom: 0.2rem;
}

.session-description .desc-text {
  font-style: italic;
  opacity: 0.85;
}


.session-description {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: #dcdcdc;
  font-size: 0.9rem;
  line-height: 1.4rem;
  max-height: 4.5rem;
  overflow: hidden;
}

.session-description .desc-label {
  font-weight: bold;
  color: var(--accent);
  display: block;
  margin-bottom: 0.2rem;
}

.session-description .desc-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  /* ✅ Standard property */
  line-clamp: 2;
  box-orient: vertical;

  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}


.desc-counter {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.75rem;
  color: #aaa;
  opacity: 0.8;
  pointer-events: none; /* clicks still go to textarea */
}

.textarea-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.textarea-wrapper textarea {
  display: block;         /* removes inline spacing */
  width: 100%;            /* forces textarea to fill wrapper */
  margin: 0;              /* prevent extra spacing pushing wrapper */
  box-sizing: border-box; /* so padding is included */
  padding-right: 40px;    /* space for counter */
}

.desc-counter {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.75rem;
  color: #aaa;
  opacity: 0.8;
  pointer-events: none;
}

.session-details {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.session-details p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6e6e6;
}

.session-details p:last-child {
  border-bottom: none;
}

.session-details i {
  color: #d4af37;
  font-size: 0.95rem;
  min-width: 18px;
}


/* ❌ Cancel session button (red variant for organizer) */
.session-delete.cta-danger {
    background: linear-gradient(to right, #b33939, #e55039);
    border: none;
    color: #fff;
    font-weight: bold;
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.session-delete.cta-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 80, 57, 0.4);
}


.hidden {
  display: none !important;
}
