/* General Styles */
:root {
  --primary-color: #00a99d;
  --primary-dark: #008b80;
  --secondary-color: #2c3e50;
  --light-color: #ecf0f1;
  --dark-color: #34495e;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --gray-color: #95a5a6;
  --border-radius: 4px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Roboto', 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--secondary-color);
  background-color: #f9f9f9;
  margin: 0;
  padding: 0;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn:hover {
  background-color: var(--primary-dark);
  color: white;
}

.btn-success {
  background-color: var(--success-color);
}

.btn-success:hover {
  background-color: #27ae60;
}

.btn-warning {
  background-color: var(--warning-color);
}

.btn-warning:hover {
  background-color: #d35400;
}

.btn-danger {
  background-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-secondary {
  background-color: var(--gray-color);
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
}

.alert-success {
  background-color: #d5f5e3;
  color: #1e8449;
}

.alert-warning {
  background-color: #fef9e7;
  color: #b7950b;
}

.alert-error {
  background-color: #fadbd8;
  color: #922b21;
}

/* Header */
.header {
  background-color: white;
  box-shadow: var(--box-shadow);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-item {
  margin-left: 1.5rem;
}

.navbar-link {
  color: var(--secondary-color);
  font-weight: 500;
}

.navbar-link:hover {
  color: var(--primary-color);
}

.navbar-link.active {
  color: var(--primary-color);
  font-weight: bold;
}

.cart-icon {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--danger-color);
  color: white;
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Breadcrumbs */
.breadcrumbs {
  margin: 1rem 0;
  padding: 0.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.breadcrumbs-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.breadcrumbs-item {
  margin-right: 0.5rem;
}

.breadcrumbs-item:after {
  content: "›";
  margin-left: 0.5rem;
  color: var(--gray-color);
}

.breadcrumbs-item:last-child:after {
  content: "";
}

/* Gallery */
.gallery-header {
  margin-bottom: 1.5rem;
}

.gallery-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.gallery-container {
  margin-top: 2rem;
}

.gallery-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.folder-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  cursor: pointer;
}

.folder-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.folder-thumbnail {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
  background-color: var(--light-color);
}

.folder-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.folder-card:hover .folder-thumbnail img {
  transform: scale(1.1);
}

.folder-title {
  padding: 0.8rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.image-card {
  position: relative;
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  cursor: pointer;
}

.image-thumbnail {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
}

.image-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.image-card:hover .image-thumbnail img {
  transform: scale(1.1);
}

.image-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transition: var(--transition);
}

.image-card:hover .image-actions {
  opacity: 1;
}

.action-btn {
  background-color: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
}

.action-btn:hover {
  color: var(--primary-color);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  /* Header and footer keep their natural height, the image gets whatever is
     left. minmax(0, 1fr) lets the middle row shrink below the image's
     intrinsic size, so the footer (add-to-cart button) never leaves the
     screen on phones and tablets. */
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh; /* mobile browsers: excludes the address bar */
}

.lightbox-header {
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.lightbox-title {
  font-size: 1.2rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.lightbox-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 0 10%;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition);
}

.lightbox-nav:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
  left: 0;
}

.lightbox-next {
  right: 0;
}

.lightbox-nav-icon {
  color: white;
  font-size: 2rem;
}

.lightbox-footer {
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

.lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Cart */
.cart-container {
  margin-top: 2rem;
}

.cart-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-title {
  font-size: 1.8rem;
  margin: 0;
}

.cart-actions {
  display: flex;
  gap: 1rem;
}

.cart-empty {
  text-align: center;
  padding: 2rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.cart-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.cart-item {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  position: relative;
}

.cart-item-thumbnail {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
}

.cart-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: var(--danger-color);
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  transition: var(--transition);
}

.cart-item-remove:hover {
  opacity: 1;
}

/* Order Form */
.order-container {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.order-preview {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
}

.order-form {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 169, 157, 0.2);
}

.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--gray-color);
}

.form-error {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.preview-item {
  display: flex;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.preview-thumbnail {
  width: 80px;
  height: 60px;
  overflow: hidden;
  margin-right: 1rem;
}

.preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-details {
  flex: 1;
}

.preview-path {
  font-size: 0.875rem;
  color: var(--gray-color);
  word-break: break-all;
}

.quantity-input {
  width: 60px;
  text-align: center;
}

/* Admin */
.admin-login {
  max-width: 400px;
  margin: 4rem auto;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-title {
  font-size: 1.8rem;
  margin: 0;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  text-align: center;
}

.dashboard-card-value {
  font-size: 2rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.dashboard-card-label {
  color: var(--gray-color);
}

.admin-section {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  font-weight: 500;
  background-color: #f8f9fa;
}

.table tr:hover {
  background-color: #f8f9fa;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.status-new {
  background-color: #d5f5e3;
  color: #1e8449;
}

.status-processing {
  background-color: #fef9e7;
  color: #b7950b;
}

.status-completed {
  background-color: #e0f5f3;
  color: #00776e;
}

.status-cancelled {
  background-color: #fadbd8;
  color: #922b21;
}

.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.order-detail-section {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
}

.detail-row {
  display: flex;
  margin-bottom: 0.75rem;
}

.detail-label {
  width: 40%;
  font-weight: 500;
}

.detail-value {
  width: 60%;
}

/* Order Confirmation Styles */
.confirmation-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.confirmation-box {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.confirmation-box.show {
  opacity: 1;
  transform: translateY(0);
}

.confirmation-icon {
  font-size: 4rem;
  color: var(--success-color);
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

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

.confirmation-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
}

.confirmation-message {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--secondary-color);
}

.confirmation-details {
  text-align: left;
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: #f9f9f9;
  border-radius: var(--border-radius);
}

.process-steps {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.process-step {
  display: flex;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.process-step.show {
  opacity: 1;
  transform: translateX(0);
}

.step-number {
  background-color: var(--primary-color);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 1rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}

.confirmation-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.thank-you-message {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
}

/* Responsive */
@media (max-width: 768px) {
  .order-container {
    grid-template-columns: 1fr;
  }
  
  .order-detail-grid {
    grid-template-columns: 1fr;
  }
  
  .navbar {
    flex-direction: column;
  }
  
  .navbar-menu {
    margin-top: 1rem;
  }
  
  .navbar-item {
    margin-left: 1rem;
    margin-right: 1rem;
  }
  
  .confirmation-box {
    padding: 1.5rem;
  }
  
  .process-step {
    flex-direction: column;
  }
  
  .step-number {
    margin-bottom: 0.5rem;
  }

  /* Menu wraps instead of widening the page (which made phones zoom out) */
  .navbar-menu {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
  }

  .navbar-item {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }

  .cart-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .cart-actions {
    flex-wrap: wrap;
  }

  .cart-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

  .lightbox-content {
    padding: 0 3rem;
  }
}

/* Short screens (phones in landscape): compact lightbox chrome so the image
   and the add-to-cart button both fit */
@media (max-height: 500px) {
  .lightbox-header {
    padding: 0.4rem 1rem;
  }

  .lightbox-title {
    font-size: 1rem;
  }

  .lightbox-footer {
    padding: 0.4rem 1rem;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
  }

  .lightbox-footer .btn {
    padding: 0.35rem 0.8rem;
  }
}

/* Touch devices have no hover: show the card buttons (view, add to cart)
   permanently, otherwise they cannot be reached on phones and tablets */
@media (hover: none) {
  .image-card .image-actions {
    opacity: 1;
  }

  .image-card:hover .image-thumbnail img {
    transform: none;
  }

  .image-card .image-actions {
    padding: 0.25rem 0.5rem;
  }

  .action-btn {
    padding: 0.35rem 0.6rem;
    font-size: 1.1rem;
  }

  .lightbox-nav {
    opacity: 0.8;
  }
}

/* File Manager Styles */
.file-manager-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--light-color);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb-item {
  padding: 5px 8px;
  color: var(--secondary-color);
  text-decoration: none;
}

.breadcrumb-item:hover {
  background-color: rgba(0,0,0,0.05);
  border-radius: 4px;
}

.breadcrumb-separator {
  color: var(--gray-color);
  margin: 0 2px;
}

.file-manager-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.file-item {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  background-color: white;
}

.file-item:hover {
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.file-link {
  display: block;
  text-decoration: none;
  color: var(--secondary-color);
  padding: 15px;
}

.file-icon {
  display: flex;
  justify-content: center;
  font-size: 36px;
  color: var(--warning-color);
  margin-bottom: 10px;
}

.file-thumbnail {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.file-thumbnail img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.file-name {
  text-align: center;
  word-break: break-word;
  font-size: 14px;
  height: 2.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.file-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 2px;
  z-index: 10;
}

.file-item:hover .file-actions {
  display: flex;
}

.empty-folder {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 0;
  color: var(--gray-color);
  background-color: #f8f9fa;
  border-radius: 8px;
}

.empty-folder i {
  font-size: 48px;
  margin-bottom: 10px;
}
