/* === Base Layout & Global Styles === */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #f0f0f0;
    background-color: #121212;
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
}

/* === Main Container === */
.container {
    max-width: 1200px;
    margin: auto;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(14px);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.05);
    display: none;
    animation: fadeInScale 0.7s ease-in-out;
    transition: all 0.3s ease-in-out;


}
.snapshot-buttons button {
    padding: 8px 12px;
    border-radius: 6px;
    background: #333;
    color: #eee;
    border: 1px solid #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.snapshot-buttons button:hover {
    background: #4e9cff;
    color: #fff;
}
/* === Typography === */
h1 {
    color: #f04545;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2,
h3 {
    color: #ff6666;
    margin-bottom: 0.5rem;
}

/* === Grid Layout === */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* === Card Component === */
.card {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid #000;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(255, 0, 0, 0.2);
}

/* === Form Elements === */
input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #1e1e1e;
    color: #eee;
    font-size: 15px;
}

input::placeholder {
    color: #aaa;
}

/* === Buttons === */
button {
    display: inline-block;
    background: #f04545;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.25s ease;
}

button:hover {
    background: #d63031;
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.3);
}

button.danger {
    background: #ff4d4d;
}

button.danger:hover {
    background: #c0392b;
}

button.secondary {
    background: #888;
    color: #000;
}

button.secondary:hover {
    background: #777;
}

/* === List & Items === */
ul {
    padding-left: 0;
}

.list-item {
    list-style-type: none;
    padding: 14px;
    border-bottom: 1px solid #333;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background-color: rgba(30, 30, 30, 0.6);
    border-radius: 8px;
}

.item-info {
    flex-grow: 1;
}

.item-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* === Graduated Text === */
.graduated .item-info {
    color: #7f8c8d;
    text-decoration: line-through;
}

/* === Elo Text Highlight === */
.elo-rating {
    font-weight: bold;
    color: #ff5252;
}

/* === Info Note === */
.note {
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 4px solid #f04545;
    padding: 12px;
    margin-top: 15px;
    font-size: 0.9em;
    color: #eee;
    border-radius: 6px;
}

/* === Annotations List === */
#annotationsList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #333;
}

/* === Chart Controls Section === */
.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 16px;
}

/* === Login Screen === */
#loginScreen {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(12px);
    color: #f0f0f0;
    z-index: 2;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.25);
    animation: fadeInSlide 0.6s ease-out;
}

#loginScreen h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #ff5555;
}

#loginBtn {
    background: #f04545;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 0 10px #ff555566;
    transition: all 0.3s ease;
}

#loginBtn:hover {
    background: #d32f2f;
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff0000aa;
}

/* === Vanta Background === */
#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -10;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* === Animations === */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Credits Card Styling */
.credits-card {
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.9), rgba(10, 10, 10, 0.95));
    border: 1px solid #cc2b2b;
    color: #f5f5f5;
    text-align: center;
    padding: 1.75rem;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(204, 43, 43, 0.25);
    margin-top: 50px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.credits-card h3 {
    color: #ff4c4c;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(255, 76, 76, 0.5);
}

.credits-card p {
    font-size: 1rem;
    color: #ccc;
    letter-spacing: 0.6px;
}

/* Hover effect */
.glow-on-hover:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 0 25px rgba(255, 50, 50, 0.4), 0 0 8px rgba(255, 0, 0, 0.2);
}

/* Animation on entry */
@keyframes fadeInBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.animate-fade-in {
    animation: fadeInBottom 1s ease-out;
}

.rank-number {
    font-weight: bold;
    color: #ff4c4c;
    margin-right: 8px;
}

.grid-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.rank-diff {
    margin-left: 6px;
    font-weight: bold;
    opacity: 0;
    animation: fadeSlideIn 0.6s ease-out forwards;
}

.rank-up {
    color: #4caf50;
}

.rank-down {
    color: #e74c3c;
}

@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#loadingOverlay {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #121212;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    animation: fadeInSlide 0.5s ease-in-out;
    display: none;
        opacity: 0;
        transition: opacity 0.6s ease;
}

.container {
    display: none;
}
.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f04545;
    border-top: 6px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#logoutBtn:hover svg {
    stroke: #e74c3c;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

#toast {
    visibility: hidden;
    min-width: 280px;
    max-width: 80%;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 16px 24px;
    position: fixed;
    z-index: 9999;
    bottom: 40px;
    right: 40px;
    font-size: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
    opacity: 0;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: #2ecc71;
}

.toast-error {
    background-color: #e74c3c;
}

.toast-warning {
    background-color: #f39c12;
}

.toast-info {
    background-color: #3498db;
}
.container {
    display: none;
}

.viewer-container {
        max-width: 1200px;
            margin: auto;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(14px);
            padding: 30px;
            border-radius: 16px;
            box-shadow: 0 0 40px rgba(255, 0, 0, 0.1);
            border: 1px solid rgba(255, 0, 0, 0.05);
            display: none;
            animation: fadeInScale 0.7s ease-in-out;
            transition: all 0.3s ease-in-out;
}

#loadingOverlay {
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.avg-elo-banner {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ff4c4c;
    text-align: center;
    margin-bottom: 16px;
    text-shadow: 0 0 8px rgba(255, 76, 76, 0.4);
    animation: fadeInSlide 0.4s ease-out;
}
.card input,
.card select,
.card textarea {
    width: 100%;
    box-sizing: border-box;
}
.card input[type="checkbox"] {
    width: auto;
    /* optionally set height to normal checkbox height */
    height: auto;
    margin-right: 8px;
    /* add some space before label */
}
#practiceRoundsPagination button,
#tournamentsPagination button {
    background: #f04545;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#practiceRoundsPagination button:disabled,
#tournamentsPagination button:disabled {
    background: #555;
    cursor: not-allowed;
}

#practiceRoundsPagination button:hover:not(:disabled),
#tournamentsPagination button:hover:not(:disabled) {
    background: #d63031;
}

/* === Card Flip Effect for Debater Profile === */
.flip-card {
    background: none;
    perspective: 1200px;
    position: relative;
    width: 400px;
    min-height: 340px;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    cursor: pointer;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4,0,0.2,1);
    transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    min-height: 340px;
    backface-visibility: hidden;
    background: #222;
    border-radius: 16px;
    box-shadow: 0 8px 32px #000a;
    padding: 32px 24px 24px 24px;
    overflow: auto;
    color: #f0f0f0;
}
.flip-card-front {
    z-index: 2;
}
.flip-card-back {
    transform: rotateY(180deg);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
}
.flip-card-back h3 {
    margin-top: 0;
    color: #ff4c4c;
    margin-bottom: 18px;
}
#debaterProfileHighestElo, #debaterProfileTournaments, #debaterProfileGraduation {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #eee;
}
#debaterProfileGraduation {
    margin-bottom: 0;
}
#debaterProfileModal button#closeDebaterProfile,
#debaterProfileModal button#flipBackBtn {
    z-index: 10;
}

/* --- Enhanced Debater Profile Card Styles (Tall, Centered, Full Modal, Blue-Style Layout, Black/Gray/Red Colors) --- */
.enhanced-profile-card {
  background: linear-gradient(135deg, #181818 0%, #232323 100%);
  border-radius: 22px;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,0.32), 0 1.5px 8px 0 rgba(60,0,0,0.10);
  padding: 0;
  min-width: 350px;
  min-height: 420px;
  width: 400px;
  height: 540px;
  max-width: 95vw;
  max-height: 90vh;
  position: relative;
  overflow: hidden;
  border: 1.5px solid #444;
  transition: box-shadow 0.22s, transform 0.16s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.enhanced-profile-card:hover {
  box-shadow: 0 12px 40px 0 rgba(0,0,0,0.38), 0 2px 12px 0 rgba(60,0,0,0.13);
  transform: translateY(-2px) scale(1.012);
}
.flip-card-inner {
  border-radius: 22px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flip-card-front, .flip-card-back {
  border-radius: 22px;
  background: transparent;
  color: #f3f3f3;
  padding: 36px 32px 28px 32px;
  box-sizing: border-box;
  min-height: 420px;
  min-width: 350px;
  width: 100%;
  height: 100%;
  max-width: 400px;
  max-height: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  box-shadow: none;
  overflow-y: auto;
}
.flip-card-front h2 {
  font-size: 2.1em;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  color: #ff5555;
}
#debaterProfileElo, #debaterProfileStatus, #debaterProfileWinrate {
  font-size: 1.1em;
  margin-bottom: 8px;
  color: #ff8888;
}
#debaterProfileChart {
  margin-top: 10px;
  background: #181818;
  border-radius: 12px;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
  max-width: 100%;
  height: auto;
}
.flip-btn {
  position: absolute;
  left: 32px;
  top: 12px;
  background: #232323;
  color: #fff;
  border: 1px solid #ff5555;
  border-radius: 8px;
  padding: 6px 18px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 4px 0 rgba(0,0,0,0.10);
  transition: background 0.18s, box-shadow 0.18s, border 0.18s;
  z-index: 2;
}
.flip-btn:hover {
  background: #2a2a2a;
  border: 1.5px solid #ff8888;
  color: #ff8888;
  box-shadow: 0 2px 8px 0 rgba(60,0,0,0.13);
}
.flip-card-back h3 {
  font-size: 1.3em;
  font-weight: 600;
  margin-bottom: 18px;
  color: #ff5555;
}
#debaterProfileHighestElo, #debaterProfileTournaments, #debaterProfileGraduation, #debaterProfileConsistency {
  font-size: 1.08em;
  margin-bottom: 10px;
  color: #f3f3f3;
  background: rgba(255,85,85,0.08);
  border-radius: 7px;
  padding: 7px 14px;
  width: 100%;
  text-align: center;
}
#debaterProfileConsistency {
  font-weight: 600;
  color: #ffd86b;
  background: rgba(255,216,107,0.10);
}
#debaterProfileModal {
  animation: fadeInModal 0.22s cubic-bezier(.4,1.4,.6,1) 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Responsive for small screens */
@media (max-width: 500px) {
  .enhanced-profile-card, .flip-card-front, .flip-card-back {
    min-width: 98vw;
    max-width: 99vw;
    width: 99vw;
    height: 98vw;
    min-height: 340px;
    max-height: 99vh;
    padding: 14px 2vw 14px 2vw;
  }
}