/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #ffffff;
  color: #070707;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px;
  border-bottom: 1px solid #f0f0f0;
}

.logo {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.48px;
  color: #070707;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.5);
}

.usage-count {
  font-weight: 400;
}

.user-email {
  font-weight: 400;
}

.logout-btn {
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  font-family: 'Inter', sans-serif;
}

.logout-btn:hover {
  color: #070707;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 24px 48px;
  border-bottom: 1px solid #f0f0f0;
}

.filter-btn {
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.filter-btn:hover {
  color: #070707;
}

.filter-btn.active {
  color: #000000;
  font-weight: 500;
}

/* ===== GALLERY ===== */
.gallery-container {
  padding: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 200px;
  width: 100%;
}

.gallery-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  border: 1px solid transparent;
}

.gallery-item:hover {
  background-color: #f1f1f1;
}

.gallery-item:has(.delete-btn:hover) {
  background-color: #FFEFEF;
}

.gallery-item-inner {
  position: relative;
  width: 36px;
  height: 36px;
}

.gallery-item svg {
  width: 36px;
  height: 36px;
  display: block;
}

/* ===== DOWNLOAD TOOLTIP ===== */
.download-tooltip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.2s;
}

.download-tooltip.show {
  opacity: 1;
}

/* ===== ITEM INFO (visible on hover) ===== */
.item-info {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
}

.item-name {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-size {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 1;
}

.item-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.gallery-item:hover .item-info,
.gallery-item:hover .item-size,
.gallery-item:hover .item-actions {
  opacity: 1;
}

.delete-btn {
  background: none;
  border: none;
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.2s;
  font-family: 'Inter', sans-serif;
}

.delete-btn:hover {
  color: #B70202;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 100px 48px;
  color: rgba(0, 0, 0, 0.5);
}

.empty-state h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #070707;
}

.empty-state p {
  font-size: 14px;
  font-weight: 400;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1600px) {
  .gallery {
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (max-width: 1400px) {
  .gallery {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 1200px) {
  .header,
  .filter-bar {
    padding: 32px;
  }
  
  .gallery {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 900px) {
  .logo {
    font-size: 36px;
  }
  
  .header-right {
    gap: 16px;
    font-size: 13px;
  }
  
  .filter-bar {
    gap: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 150px;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 24px;
    display: flex;
  align-items: center;
  }
  
  .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
  }
  .user-email {
    display: none;
  }
  
  .filter-bar {
    padding: 16px 24px;
  }
  
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 120px;
  }
  
  .gallery-item svg {
    width: 28px;
    height: 28px;
  }
  
  .gallery-item-inner {
    width: 28px;
    height: 28px;
  }
}

/* ===== LOGIN PAGE STYLES ===== */
.login-body {
  background: #ffffff;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  min-height: 100vh;
}

.login-header {
  padding: 48px;
  border-bottom: 1px solid #f0f0f0;
}

.login-logo {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.48px;
  color: #070707;
  margin: 0;
}

.login-content {
  padding: 0 48px;
  padding-top: 24px;
  max-width: 420px;
}

.auth-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Login Input */
.login-input {
  width: 100%;
  padding: 18px 24px;
  border: 2px solid #d4d4d4;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #070707;
  transition: border-color 0.2s;
  line-height: 18px;
  letter-spacing: 0.14px;
}

.login-input::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.login-input:focus {
  outline: none;
  border-color: #070707;
}

/* Login Button */
.login-btn {
  width: 100%;
  height: 54px;
  padding: 12px;
  background: #000000;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s;
  line-height: 18px;
  letter-spacing: 0.16px;
}

.login-btn:hover {
  opacity: 0.9;
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-btn-secondary {
  width: 100%;
  height: 54px;
  padding: 12px;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s;
}

.login-btn-secondary:hover {
  background: #e0e0e0;
}

/* Code Instruction */
.code-instruction {
  padding: 12px 0;
  font-size: 14px;
  font-weight: 400;
  color: #000000;
  text-align: center;
  line-height: 18px;
  letter-spacing: 0.14px;
  margin: 0;
  max-width: 420px;
}

/* Code Inputs Grid */
.code-inputs-grid {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.code-input {
  height: 54px;
  flex: 1 0 0;
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  border: 2px solid #d4d4d4;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  color: #070707;
  text-align: center;  /* Horizontální centrování textu */
  padding: 0;          /* Odstraníme výchozí padding */
}

.code-input:focus {
  outline: none;
  border-color: #070707;
}

.code-input.filled {
  border-color: #070707;
}

.code-input.error {
  border-color: #f5576c;
  background: #fff0f0;
}

/* Resend Link */
.resend-link {
  text-align: center;
  display: block;
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
  font-size: 14px;
  padding: 12px 0;
  line-height: 18px;
  letter-spacing: 0.14px;
}

.resend-link:hover {
  color: #070707;
}

/* Auth Info */
.auth-info,
.auth-hint {
  text-align: center;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 0;
}

/* Responsive */
@media (max-width: 600px) {
  .login-header {
    padding: 24px;
  }
  
  .login-logo {
    font-size: 36px;
  }
  
  .login-content {
    padding: 0 24px;
    padding-top: 16px;
  }
  
  .code-inputs-grid {
    gap: 4px;
  }
  
  .code-input {
    height: 48px;
    font-size: 18px;
  }
}
