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

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

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-screen:not(.active) {
  display: none;
}

.loading-content {
  text-align: center;
}

.logo-animation {
  font-size: 4rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Auth Screen */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffeef8 0%, #e8f4ff 100%);
  padding: 1rem;
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

/* ロゴコンテナ共通 */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.logo-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-message {
  color: #666;
  font-size: 1rem;
  margin: 0;
  text-align: center;
}

.auth-box {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-box h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.auth-box p {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.email-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
}

.email-input:focus {
  outline: none;
  border-color: #4ecdc4;
}

.primary-btn {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 2rem;
  color: #4ecdc4;
  text-decoration: none;
  transition: color 0.3s;
}

.back-link:hover {
  color: #ff6b6b;
}

/* Gallery Screen */
.gallery-screen {
  min-height: 100vh;
  background: #f8f9fa;
}

/* Gallery Header */
.gallery-header {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo-link:hover {
  transform: scale(1.05);
}

.header-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
}

.gallery-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-email {
  color: #666;
  font-size: 0.875rem;
}

.credit-display {
  background: rgba(255, 215, 0, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  color: #f59e0b;
  font-size: 0.875rem;
}

.logout-btn {
  background: #e0e0e0;
  color: #666;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
}

.logout-btn:hover {
  background: #d0d0d0;
}

/* Gallery Main */
.gallery-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.875rem;
  color: #666;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.3s;
}

.filter-select:focus {
  outline: none;
  border-color: #4ecdc4;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.gallery-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.gallery-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.gallery-info {
  padding: 1rem;
}

.gallery-filter {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #666;
}

.gallery-type {
  background: #f0f0f0;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.gallery-date {
  font-size: 0.75rem;
  color: #999;
}

.gallery-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.gallery-badge.free {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.gallery-badge.premium {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h2 {
  color: #333;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #666;
  margin-bottom: 2rem;
}

.empty-state .primary-btn {
  display: inline-block;
  width: auto;
  text-decoration: none;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-btn {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
  border-color: #4ecdc4;
  color: #4ecdc4;
}

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

.page-info {
  font-size: 0.875rem;
  color: #666;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
}

.image-modal {
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 1;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
}

.image-details {
  padding: 1.5rem;
}

.modal-filter {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.modal-date {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-btn {
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn:hover {
  background: #e0e0e0;
}

.action-btn.danger {
  background: #fee;
  color: #dc2626;
}

.action-btn.danger:hover {
  background: #fdd;
}

.action-btn .icon {
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .gallery-image {
    height: 150px;
  }
}

/* Footer */
.footer {
  background: white;
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid #e0e0e0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-link {
  color: #666;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s;
}

.footer-link:hover {
  color: #4ecdc4;
}

.footer-copyright {
  color: #999;
  font-size: 0.75rem;
}

.footer-copyright a {
  color: #4ecdc4;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-copyright a:hover {
  color: #ff6b6b;
}

@media (max-width: 768px) {
  .footer-links {
    gap: 1rem;
    flex-direction: column;
  }
}
EOF < /dev/null
