/* ========== ELEGANT BRANCH SELECTION PAGE ========== */

/* Main Wrapper */
.full-branch-select{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  z-index: 1000;
  display: none;
}

.full-branch-select.show{
  display: block;
}

/* Background */
.branch-shell{
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 100vh;
  min-height: 100dvh;
}

.branch-shell::before{
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
  z-index: 0;
}

.branch-shell::after{
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
  background-size: 50px 50px;
  opacity: 0.3;
  z-index: 0;
}

/* Main Panel */
.branch-panel{
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  padding: 50px 45px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  text-align: center;
  animation: panelFadeIn 0.6s ease-out;
  box-sizing: border-box;
}

@keyframes panelFadeIn{
  0%{ opacity: 0; transform: translateY(20px); }
  100%{ opacity: 1; transform: translateY(0); }
}

.branch-panel::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent,
    rgba(99, 102, 241, 0.6),
    rgba(139, 92, 246, 0.6),
    transparent
  );
  border-radius: 24px 24px 0 0;
}

.branch-panel::after{
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  animation: glowRotate 25s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes glowRotate{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

/* Logo */
.full-branch-select .app-logo-large{
  width: 100px;
  height: 100px;
  border-radius: 20px;
  object-fit: cover;
  margin: 0 auto 28px;
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.4),
    0 0 0 2px rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 3;
  transition: all 0.3s ease;
}

.full-branch-select .app-logo-large:hover{
  transform: translateY(-3px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Title */
.branch-picker-title{
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 3;
}

.branch-picker-subtitle{
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 40px 0;
  font-weight: 400;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 3;
}

/* Branch Grid */
.branch-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 30px;
  position: relative;
  z-index: 3;
  width: 100%;
  box-sizing: border-box;
}

/* Branch Card */
.glass-branch-btn{
  position: relative;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 28px 24px;
  cursor: pointer;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  animation: cardFadeIn 0.5s ease-out both;
  min-height: 120px;
  width: 100%;
  box-sizing: border-box;
}

@keyframes cardFadeIn{
  0%{ opacity: 0; transform: translateY(15px); }
  100%{ opacity: 1; transform: translateY(0); }
}

.glass-branch-btn:nth-child(1){ animation-delay: 0.05s; }
.glass-branch-btn:nth-child(2){ animation-delay: 0.1s; }
.glass-branch-btn:nth-child(3){ animation-delay: 0.15s; }
.glass-branch-btn:nth-child(4){ animation-delay: 0.2s; }
.glass-branch-btn:nth-child(5){ animation-delay: 0.25s; }
.glass-branch-btn:nth-child(6){ animation-delay: 0.3s; }

/* Card Background */
.glass-branch-btn::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.08) 0%,
    rgba(139, 92, 246, 0.08) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

/* Card Shine */
.glass-branch-btn::after{
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 60%
  );
  transform: rotate(45deg);
  transition: all 0.5s ease;
  opacity: 0;
  z-index: 1;
}

.glass-branch-btn:hover::after{
  opacity: 1;
  animation: shineSweep 0.5s ease;
}

@keyframes shineSweep{
  0%{ transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100%{ transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Hover Effects */
.glass-branch-btn:hover{
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(99, 102, 241, 0.3) inset,
    0 0 40px rgba(99, 102, 241, 0.2);
}

.glass-branch-btn:hover::before{
  opacity: 1;
}

.glass-branch-btn:active{
  transform: translateY(-2px);
}

/* Branch Name */
.branch-name{
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  position: relative;
  z-index: 2;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
}

.glass-branch-btn:hover .branch-name{
  color: #e0e7ff;
}

/* Branch Tag */
.branch-tag{
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  position: relative;
  z-index: 2;
  font-weight: 400;
  letter-spacing: 0.2px;
  transition: all 0.3s ease;
}

.glass-branch-btn:hover .branch-tag{
  color: rgba(255, 255, 255, 0.75);
}

/* Special Styling for "All Branches" */
.glass-branch-btn[data-branch="ALL_BRANCHES"]{
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.12) 0%,
    rgba(139, 92, 246, 0.12) 100%
  );
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 
    0 8px 24px rgba(99, 102, 241, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 0 30px rgba(99, 102, 241, 0.15);
}

.glass-branch-btn[data-branch="ALL_BRANCHES"]:hover{
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.18) 0%,
    rgba(139, 92, 246, 0.18) 100%
  );
  box-shadow: 
    0 12px 32px rgba(99, 102, 241, 0.3),
    0 0 0 1px rgba(99, 102, 241, 0.4) inset,
    0 0 50px rgba(99, 102, 241, 0.25);
}

/* Responsive Design */
@media (max-width: 1024px){
  .branch-panel{
    padding: 45px 40px;
    max-width: 800px;
  }
  
  .branch-grid{
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 768px){
  .branch-shell{
    padding: 20px 16px;
    align-items: flex-start;
    padding-top: 40px;
  }
  
  .branch-panel{
    padding: 35px 24px;
    border-radius: 20px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
  }
  
  .full-branch-select .app-logo-large{
    width: 85px;
    height: 85px;
    margin-bottom: 22px;
    border-radius: 18px;
  }
  
  .branch-picker-title{
    font-size: 26px;
    margin-bottom: 8px;
    line-height: 1.2;
  }
  
  .branch-picker-subtitle{
    font-size: 13px;
    margin-bottom: 32px;
    line-height: 1.4;
    padding: 0 8px;
  }
  
  .branch-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 24px;
    width: 100%;
  }
  
  .glass-branch-btn{
    padding: 26px 18px;
    border-radius: 16px;
    min-height: 125px;
    gap: 10px;
  }
  
  .branch-name{
    font-size: 16px;
    line-height: 1.3;
    margin-bottom: 4px;
  }
  
  .branch-tag{
    font-size: 11px;
    line-height: 1.3;
  }
}

@media (max-width: 480px){
  .branch-shell{
    padding: 16px 12px;
    align-items: flex-start;
    padding-top: 30px;
    padding-bottom: 30px;
  }
  
  .branch-panel{
    padding: 32px 20px;
    border-radius: 20px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
  }
  
  .full-branch-select .app-logo-large{
    width: 75px;
    height: 75px;
    margin-bottom: 20px;
    border-radius: 16px;
  }
  
  .branch-picker-title{
    font-size: 23px;
    margin-bottom: 6px;
    line-height: 1.2;
    font-weight: 700;
  }
  
  .branch-picker-subtitle{
    font-size: 12px;
    margin-bottom: 28px;
    line-height: 1.5;
    padding: 0 4px;
  }
  
  .branch-grid{
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 22px;
    width: 100%;
  }
  
  .glass-branch-btn{
    padding: 28px 24px;
    min-height: 130px;
    border-radius: 18px;
    gap: 12px;
  }
  
  .branch-name{
    font-size: 17px;
    line-height: 1.3;
    margin-bottom: 6px;
    font-weight: 600;
  }
  
  .branch-tag{
    font-size: 12px;
    line-height: 1.4;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px){
  .branch-shell{
    padding: 15px 20px;
    align-items: center;
  }
  
  .branch-panel{
    padding: 28px 30px;
    max-width: 95%;
  }
  
  .full-branch-select .app-logo-large{
    width: 65px;
    height: 65px;
    margin-bottom: 12px;
  }
  
  .branch-picker-title{
    font-size: 20px;
    margin-bottom: 4px;
  }
  
  .branch-picker-subtitle{
    font-size: 11px;
    margin-bottom: 18px;
  }
  
  .branch-grid{
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
  }
  
  .glass-branch-btn{
    padding: 22px 16px;
    min-height: 100px;
    gap: 6px;
  }
  
  .branch-name{
    font-size: 15px;
  }
  
  .branch-tag{
    font-size: 10px;
  }
}

/* RTL Support */
[dir="rtl"] .branch-panel{
  text-align: center;
}

/* Touch Improvements */
@media (max-width: 768px){
  .glass-branch-btn{
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
  }
  
  .glass-branch-btn:active{
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* Enhanced mobile backdrop blur */
  .branch-panel{
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
  }
  
  .glass-branch-btn{
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
  }
  
  /* Better spacing for mobile */
  .branch-shell{
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

/* Dark Theme Override */
body.theme-dark .full-branch-select{
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* Loading Animation */
@keyframes shimmer{
  0%{ background-position: -1000px 0; }
  100%{ background-position: 1000px 0; }
}

.glass-branch-btn.loading{
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Enhanced Mobile Luxury Styling */
@media (max-width: 480px){
  /* Enhanced shadows for depth */
  .branch-panel{
    box-shadow: 
      0 15px 50px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.08) inset,
      0 0 80px rgba(99, 102, 241, 0.1);
  }
  
  /* Enhanced card shadows */
  .glass-branch-btn{
    box-shadow: 
      0 10px 30px rgba(0, 0, 0, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.08) inset,
      0 4px 20px rgba(99, 102, 241, 0.15);
  }
  
  .glass-branch-btn:active{
    box-shadow: 
      0 6px 20px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(255, 255, 255, 0.1) inset,
      0 0 30px rgba(99, 102, 241, 0.2);
  }
  
  /* Better text contrast */
  .branch-picker-title{
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
  
  .branch-name{
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  }
}

/* Small mobile devices (320px - 375px) */
@media (max-width: 375px){
  .branch-shell{
    padding: 12px 10px;
    padding-top: 25px;
  }
  
  .branch-panel{
    padding: 28px 16px;
    border-radius: 18px;
  }
  
  .full-branch-select .app-logo-large{
    width: 70px;
    height: 70px;
    margin-bottom: 18px;
  }
  
  .branch-picker-title{
    font-size: 21px;
  }
  
  .branch-picker-subtitle{
    font-size: 11px;
    margin-bottom: 24px;
  }
  
  .branch-grid{
    gap: 12px;
    margin-top: 20px;
  }
  
  .glass-branch-btn{
    padding: 26px 20px;
    min-height: 125px;
  }
  
  .branch-name{
    font-size: 16px;
  }
}
