/* Warm Family-Friendly Design System */

:root {
  --bg-color: #faf8f5;
  --text-dark: #333333;
  --text-muted: #777777;
  --card-bg: #ffffff;
  --primary-color: #e67e22; /* Amber */
  --secondary-color: #1abc9c; /* Teal */
  
  --member-shravanth: #e67e22;
  --member-ramesh: #1abc9c;
  --member-sunitha: #e84393;
  --member-danush: #3498db;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --border-radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  background: var(--bg-color);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px; /* Space for bottom nav on mobile */
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  color: inherit;
}

/* Utilities */
.hidden { display: none !important; }
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
.text-center { text-align: center; }

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, background 0.2s;
  min-height: 48px; /* Touch target */
}

.btn-primary:hover {
  background: #f39c12;
  transform: translateY(-2px);
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  transition: background 0.2s;
}

/* Offline Banner */
#offline-banner {
  background: #ff4757;
  color: white;
  text-align: center;
  padding: 10px;
  font-weight: 500;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* App Container */
#app {
  min-height: 100vh;
  position: relative;
}

/* Landing Page */
.landing-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 20px;
}
.landing-page h1 { font-size: 2.5rem; margin-bottom: 10px; color: var(--primary-color); }
.landing-page p { color: var(--text-muted); margin-bottom: 30px; }

/* Dashboard Cards */
.grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.folder-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  cursor: pointer;
}
.folder-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.folder-card .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: white;
}
.folder-card.member-Shravanth .avatar { background: var(--member-shravanth); }
.folder-card.member-Ramesh .avatar { background: var(--member-ramesh); }
.folder-card.member-Sunitha .avatar { background: var(--member-sunitha); }
.folder-card.member-Danush .avatar { background: var(--member-danush); }
.folder-card.member-Common .avatar { background: #9b59b6; }

/* File List / Grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.file-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.file-card .thumbnail-area {
  height: 120px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.file-card .thumbnail-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}
.file-card .thumbnail-area img.loaded { opacity: 1; }
.file-card .thumbnail-area .icon { font-size: 40px; position: absolute; }
.file-card .info { padding: 12px; }
.file-card .info .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.file-card .info .meta { font-size: 12px; color: var(--text-muted); }

/* Search Bar */
.search-container {
  position: relative;
  margin: 20px 0;
}
.search-container input {
  width: 100%;
  padding: 16px 48px;
  border-radius: 30px;
  border: 1px solid #eee;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
  outline: none;
}
.search-container input:focus { border-color: var(--primary-color); }

/* Modal */
.modal-overlay {
  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: 2000;
  padding: 20px;
}
.modal-content {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
}
.preview-container { height: 300px; background: #eee; }
.preview-container img { width: 100%; height: 100%; object-fit: contain; }
.preview-container iframe { width: 100%; height: 100%; border: none; }
.modal-info { padding: 20px; }
.modal-actions {
  display: flex; gap: 10px; padding: 0 20px 20px; justify-content: center;
}
.modal-actions button {
  flex: 1; padding: 12px; border-radius: 8px; font-weight: 500;
  background: #f0f0f0;
}
.modal-actions .btn-download { background: #3498db; color: white; }
.modal-actions .btn-share { background: var(--primary-color); color: white; }
.modal-actions .btn-delete { background: #e74c3c; color: white; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 10px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; color: var(--text-muted); font-size: 12px; gap: 4px;
}
.nav-item.active { color: var(--primary-color); }
.fab-upload {
  position: absolute;
  top: -24px;
  background: var(--primary-color);
  color: white;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-md);
}

/* Header */
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.header-title { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* Auto Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-dark: #f0f0f0;
    --text-muted: #a0a0a0;
    --card-bg: #1e1e1e;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.8);
  }
  
  .bottom-nav {
    background: #1e1e1e;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
  }
  
  .search-container input {
    background: #2c2c2c;
    border-color: #444;
    color: #f0f0f0;
  }
  
  .file-card .thumbnail-area {
    background: #2c2c2c;
  }
  
  .skeleton {
    background: linear-gradient(90deg, #2c2c2c 25%, #3a3a3a 50%, #2c2c2c 75%);
  }
  
  .btn-icon {
    background: #2c2c2c;
  }
  
  .modal-actions button {
    background: #2c2c2c;
    color: #f0f0f0;
  }
  
  .modal-actions .btn-download,
  .modal-actions .btn-share,
  .modal-actions .btn-delete {
    color: white;
  }
  
  /* Audit Table Dark Mode */
  #audit-content > div {
    background: #1e1e1e !important;
  }
  #audit-content table tr {
    border-bottom: 1px solid #333 !important;
  }
}
