/* css/stadcafe.css */

.stadcafe-body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

/* Nav */
.stadcafe-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.stadcafe-nav .nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main */
.stadcafe-main {
    padding: 178px 5% 40px 5% !important;
    max-width: 1400px;
    margin: 0 auto;
}

.stadcafe-header {
    text-align: center;
    margin-bottom: 40px;
}

.stadcafe-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #fdb913 0%, #ff8c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stadcafe-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

/* Toolbar - Fixed right below Nav */
.stadcafe-toolbar {
    position: fixed !important;
    top: 89px !important;
    left: 0 !important;
    width: 100% !important;
    height: 68px !important;
    z-index: 99 !important;
    background: rgba(18, 18, 18, 0.98) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 12px 5% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 15px !important;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.search-box input:focus {
    border-color: #fdb913;
    background: rgba(255, 255, 255, 0.1);
}

.btn-upload-pool {
    background: linear-gradient(135deg, #fdb913 0%, #ff8c00 100%);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(253, 185, 19, 0.4);
}

.btn-upload-pool:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 185, 19, 0.6);
}

/* Grid */
/* Grid is now flex column via rule at bottom */

@media (max-width: 600px) {
    .search-box { max-width: 100%; }
}

.stadcafe-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.stadcafe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(253, 185, 19, 0.3);
}

.stadcafe-card img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
}

.stadcafe-card:hover .card-overlay {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stand-badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-pin {
    background: #fdb913;
    color: #000;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.btn-pin:hover {
    transform: scale(1.1);
}

.card-footer {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.match-info {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.uploader-info {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-dialog-card {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px 25px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    position: relative;
}

.custom-dialog-card .btn-dialog-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    z-index: 10;
    border: none;
    cursor: pointer;
    padding: 0;
}

.custom-dialog-card .btn-dialog-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: scale(1.1);
}

.upload-modal {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.btn-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-close:hover {
    color: white;
}

.modal-body {
    padding: 20px;
}

.input-field {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.input-field:focus {
    border-color: #fdb913;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #fdb913 0%, #ff8c00 100%);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.match-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.match-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.match-result-teams {
    font-weight: 600;
    font-size: 0.95rem;
}

.match-result-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Custom Dialog Styles - Ported from app */
.custom-dialog-card {
  background: #1C1C1E !important;
  border: 1px solid #3A3A3C !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  max-width: 320px !important;
  padding: 24px !important;
  text-align: center !important;
  color: #fff;
}

.custom-dialog-card h3 {
  font-family: 'Bebas Neue', sans-serif !important;
  font-size: 1.65rem !important;
  letter-spacing: 1px !important;
  color: #ffffff !important;
  margin: 0 0 12px 0 !important;
}

.custom-dialog-card p {
  font-size: 0.94rem !important;
  color: #a0a0a0 !important;
  line-height: 1.5 !important;
  margin: 0 0 24px 0 !important;
}

.custom-dialog-card .dialog-actions {
  display: flex;
  gap: 12px !important;
  justify-content: center !important;
}

.custom-dialog-card .dialog-actions button {
  flex: 1 !important;
}

.custom-dialog-card .dialog-actions .nav-cta {
  flex: 0 0 auto !important;
}

.custom-dialog-card .btn {
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  padding: 12px !important;
  transition: all 0.2s ease !important;
  cursor: pointer;
  border: none;
}

.custom-dialog-card .btn-primary {
  background: linear-gradient(135deg, #F35C33 0%, #F9A900 100%) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.custom-dialog-card .btn-primary:hover {
  opacity: 0.9 !important;
  transform: translateY(-1px) !important;
}

.custom-dialog-card .btn-danger {
  background: #2e3038 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: none !important;
}

.custom-dialog-card .btn-danger:hover {
  background: #383a44 !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.custom-dialog-card .btn-warning {
  background: #36342e !important;
  color: #ffca28 !important;
  border: 1px solid rgba(255, 202, 40, 0.35) !important;
  box-shadow: none !important;
}

.custom-dialog-card .btn-warning:hover {
  background: #423f36 !important;
  border-color: rgba(255, 202, 40, 0.5) !important;
}

.custom-dialog-card .btn-outline {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #a0a0a0 !important;
}

.custom-dialog-card .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.dialog-icon-container {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px auto;
  font-size: 1.4rem;
  background: rgba(255, 255, 255, 0.05);
}

.dialog-icon-container svg {
  width: 32px;
  height: 32px;
}

.dialog-icon-container.danger {
  background: rgba(255, 69, 58, 0.15) !important;
  color: #FF453A !important;
  border: 1px solid rgba(255, 69, 58, 0.3) !important;
}

.dialog-icon-container.success {
  background: rgba(48, 209, 88, 0.15) !important;
  color: #30D158 !important;
  border: 1px solid rgba(48, 209, 88, 0.3) !important;
}

.dialog-icon-container.warning {
  background: rgba(255, 159, 10, 0.15) !important;
  color: #FF9F0A !important;
  border: 1px solid rgba(255, 159, 10, 0.3) !important;
}

.dialog-icon-container.info {
  background: rgba(10, 132, 255, 0.15) !important;
  color: #0A84FF !important;
  border: 1px solid rgba(10, 132, 255, 0.3) !important;
}

/* =========================================
   2. MAIN GRID (LOBBY / FEED)
========================================= */
.stadcafe-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.stadcafe-card {
    /* For fallback styling, but we'll use room-card from stadcafe_room.css */
}

/* =========================================
   FAZ 0: MOBILE OPTIMIZATIONS (STRICTLY <= 768px)
========================================= */
/* Safely hide empty nav-links to remove the double horizontal line without affecting other pages */
.stadcafe-body nav .nav-links {
  display: none !important;
}

@media (max-width: 768px) {
  /* Fix Main Container Padding (Compensated for fixed navbar & fixed toolbar) */
  .stadcafe-main {
    padding: calc(152px + env(safe-area-inset-top, 0px)) 15px 20px 15px !important;
  }
  
  .stadcafe-toolbar {
    top: calc(77px + env(safe-area-inset-top, 0px)) !important;
    padding: 10px 15px !important;
    height: 64px !important;
  }
  
  /* Remove row gap since nav-links is hidden */
  .stadcafe-body nav {
    row-gap: 0 !important;
  }
  
  /* Fix Header Overflow */
  .stadcafe-header h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  

  .stadcafe-header p {
    font-size: 0.95rem;
    padding: 0 10px;
  }
  
  /* Toolbar Alignment fixed for side-by-side layout */
  .toolbar-actions-left {
    justify-content: center;
  }
  
  /* Force 1 Column Grid on Small Devices */
  .stadcafe-grid {
    column-count: 1 !important;
    column-gap: 0;
  }
  .stadcafe-card {
    margin-bottom: 20px;
  }
  
  /* Fix Upload Modal Overflow */
  .upload-modal {
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-body {
    padding: 15px;
  }
  
  /* Fix Custom Alert Stacking */
  .custom-alert {
    width: 90% !important;
    min-width: unset !important;
    right: 5% !important;
    top: 10px !important;
  }
  
  /* Fix Custom Dialog Overflow */
  .custom-dialog-card {
    width: 90% !important;
    max-width: 100% !important;
    padding: 20px !important;
  }
}

#header-subtitle-stadcafe {
  font-family: 'Bebas Neue', sans-serif !important;
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 1px;
  line-height: 1;
  display: block;
}

/* ==========================================
   STADCAFE TAM EKRAN MAÇ SEÇİMİ (v9.4.12 - Kalıcı Çözüm)
   ========================================== */
/* Nav'ı tüm modalların (auth_modal z-index:1050 dahil) üstüne çıkar — nav hiçbir zaman lobi tam ekran modalları tarafından örtülmez */
.stadcafe-body nav {
  z-index: 1100 !important;
}
#upload-modal-overlay:has(.full-screen-select) {
  z-index: 1000 !important;
  padding: 0 !important;
}
.upload-modal.full-screen-select {
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  background: #0f0f0f !important;
  /* Nav yüksekliğini geç — nav'ın altından başla (sabit nav yüksekliği ~80px mobilde) */
  padding-top: calc(78px + env(safe-area-inset-top, 0px)) !important;
}
.upload-modal.full-screen-select #upload-modal-header {
  display: none !important;
}
.upload-modal.full-screen-select .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  min-height: 0;
}
.upload-modal.full-screen-select .upload-step:not([style*="none"]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.select-page-topbar {
  background: #181818;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.select-page-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.select-season-dropdown {
  background: #252525;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 10px;
  font-size: 0.88rem;
  cursor: pointer;
  outline: none;
}
.select-match-search {
  flex: 1;
  background: #252525;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  outline: none;
}
.select-match-search:focus {
  border-color: #fdb913;
}
.btn-confirm-green {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #2ecc71 !important;
  background: rgba(46, 204, 113, 0.06) !important;
  border: 1px solid rgba(46, 204, 113, 0.35) !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.2s ease, 
              border-color 0.2s ease, 
              box-shadow 0.2s ease !important;
}
.btn-confirm-green:hover {
  background: rgba(46, 204, 113, 0.15) !important;
  border-color: rgba(46, 204, 113, 0.6) !important;
  color: #ffffff !important;
  transform: scale(1.05) !important;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.25) !important;
}
.btn-confirm-green:active {
  color: #ffffff !important;
  transform: scale(0.95) !important;
}
.btn-confirm-green svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.5 !important;
}
.fullscreen-matches-list {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 16px 16px 96px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  align-content: start;
}
.match-select-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.match-select-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(253, 185, 19, 0.5);
}
.match-select-card.selected {
  border-color: rgba(46, 204, 113, 0.45) !important;
  background: linear-gradient(135deg, 
    rgba(30, 204, 120, 0.05), 
    rgba(46, 204, 113, 0.07)
  ) !important;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.25) !important;
}
.match-select-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}
.match-select-card .card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.match-select-card .card-info-blur {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.match-select-card .card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.3;
}
.match-select-card .card-score {
  font-weight: 800;
  font-size: 1.25rem;
  color: #fdb913;
  white-space: nowrap;
}
.match-select-card .card-check {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: transparent;
}
.match-select-card.selected .card-check {
  background-color: rgba(0, 0, 0, 0.6) !important;
  border-color: rgba(46, 204, 113, 0.85) !important;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.35);
}
.match-select-card.selected .card-check::after {
  content: '✓';
  background: linear-gradient(45deg, #38ef7d, #11998e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 12px;
  font-weight: 800;
  display: inline-block;
}
.match-select-card.room-open {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.03) !important;
  cursor: not-allowed;
  pointer-events: none;
}
.match-select-card.room-open .card-main {
  opacity: 0.55 !important;
  filter: blur(1.5px) !important;
}
.match-select-card.room-open .room-open-badge {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.18) !important;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .select-page-filter-row {
    flex-wrap: wrap;
  }
  .select-season-dropdown {
    width: 120px;
  }
  .select-match-search {
    flex: 1;
    min-width: 150px;
  }
}

/* Virtual Items Overlays - Moved to inline GPU accelerated JS */
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 0 40px rgba(0, 150, 255, 1)); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}
