/* General Layout */
body {
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #e0f7fa, #c5cae9, #fce4ec);
  margin: 0;
  padding: 0;
}

/* Header */
.main-header {
  background-color: #2d89ef;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-header h1 {
  margin: 0;
  font-size: 1.6em;
}

#logoutBtn {
  background: #e53935;
  border: none;
  padding: 8px 16px;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

#logoutBtn:hover {
  background: #c62828;
}

/* Container */
.container {
  max-width: 960px;
  margin: auto;
  padding: 20px;
}

/* Welcome Message */
.welcome-text {
  margin-top: 20px;
  font-size: 1.2em;
  color: #333;
  text-align: center;
}

/* Upload Form */
#uploadForm {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
  gap: 10px;
}

input[type="file"] {
  padding: 5px;
}

button {
  padding: 10px 16px;
  background-color: #2d89ef;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #1b6fc2;
}

/* Error Message */
.error {
  color: red;
  font-size: 0.9em;
}

/* Media Grid Sections */
.media-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.media-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  position: relative;
}

.media-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
  border-bottom: 1px solid #ddd;
}

.media-info {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.delete-btn {
  background: rgba(255, 0, 0, 0.8);
  border: none;
  color: white;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9em;
}

.delete-btn:hover {
  background: rgba(200, 0, 0, 0.9);
}

/* Modal Viewer */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

#modalContent img,
#modalContent video {
  max-width: 90%;
  max-height: 80%;
}

#closeModal {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2em;
  color: white;
  cursor: pointer;
}

/* Section Headings */
#mediaFeed > div > h2 {
  margin-top: 40px;
  margin-bottom: 10px;
  font-size: 1.4em;
  color: #333;
}

/* Responsive Header */
@media (max-width: 600px) {
  .main-header {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
  }

  #uploadForm {
    padding: 0 10px;
  }
}
