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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.background-flow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
  animation: flow 20s ease-in-out infinite;
  z-index: -1;
}

@keyframes flow {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(180deg); }
}

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

header {
  text-align: center;
  margin-bottom: 25px;
  color: white;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  min-height: 70vh;
}

/* Left Panel - More Compact */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.create-card {
  background: rgba(255, 255, 255, 0.92);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.create-card h2 {
  color: #333;
  margin-bottom: 18px;
  text-align: center;
  font-size: 1.4rem;
}

textarea {
  width: 100%;
  height: 100px;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s;
  background: rgba(255, 255, 255, 0.9);
}

textarea:focus {
  outline: none;
  border-color: #667eea;
  background: white;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

.file-upload {
  margin: 15px 0;
}

.file-label {
  display: inline-block;
  padding: 10px 16px;
  background: rgba(248, 249, 250, 0.8);
  border: 2px dashed #dee2e6;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  width: 100%;
  font-size: 14px;
}

.file-label:hover {
  background: rgba(233, 236, 239, 0.9);
  border-color: #667eea;
}

.file-label input {
  display: none;
}

.visibility-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.3s;
  font-size: 14px;
}

.radio-option:hover {
  background: rgba(248, 249, 250, 0.8);
}

.radio-option input {
  display: none;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.radio-custom::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  display: none;
}

input:checked + .radio-custom {
  border-color: #667eea;
}

input:checked + .radio-custom::after {
  display: block;
}

.create-button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}

.create-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.link-output {
  margin-top: 12px;
  padding: 12px;
  background: rgba(231, 243, 255, 0.9);
  border-radius: 10px;
  border-left: 4px solid #667eea;
  display: none;
  font-size: 14px;
}

.private-messages {
  background: rgba(255, 255, 255, 0.92);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  min-height: 200px;
}

.private-messages h3 {
  color: #333;
  margin-bottom: 15px;
  text-align: center;
  font-size: 1.2rem;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

/* Right Panel - More Compact */
.right-panel {
  height: fit-content;
}

.public-wall {
  background: rgba(255, 255, 255, 0.92);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  min-height: 200px;
}

.public-wall h2 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.4rem;
}

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  max-height: 500px;
  overflow-y: auto;
  padding: 5px;
}

/* Message Card Styles */
.message-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  backdrop-filter: blur(8px);
}

.message-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border-color: #667eea;
}

.message-card.private {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 244, 255, 0.95));
  border: 2px solid #667eea;
}

.message-content {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
}

.message-meta {
  font-size: 11px;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.has-image::after {
  content: '📷';
  margin-left: 5px;
}

/* Dropdown for private messages */
.private-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  padding: 8px;
  margin-top: 5px;
  display: none;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.message-card.private:hover .private-dropdown {
  display: block;
}

.forward-btn {
  width: 100%;
  padding: 6px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.3s;
}

.forward-btn:hover {
  background: #5a6fd8;
}

/* Message View Styles */
.message-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.message-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 35px;
  border-radius: 18px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.message-text {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 20px;
  color: #333;
}

.message-img {
  max-width: 100%;
  border-radius: 10px;
  margin: 15px 0;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.status-message {
  padding: 12px;
  background: rgba(255, 243, 205, 0.9);
  color: #856404;
  border-radius: 8px;
  margin: 15px 0;
  border: 1px solid #ffeaa7;
}

.back-btn {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 14px;
}

.back-btn:hover {
  background: #5a6268;
}

.hidden {
  display: none !important;
}

.no-messages, .error {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 20px;
  background: rgba(248, 249, 250, 0.8);
  border-radius: 10px;
  border: 2px dashed #dee2e6;
}

/* Scrollbar Styling */
.wall-grid::-webkit-scrollbar,
.messages-list::-webkit-scrollbar {
  width: 6px;
}

.wall-grid::-webkit-scrollbar-track,
.messages-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.wall-grid::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  .create-card,
  .private-messages,
  .public-wall {
    padding: 20px;
  }
  
  .wall-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.8rem;
  }
  
  header p {
    font-size: 1rem;
  }
  
  .create-card,
  .private-messages,
  .public-wall {
    padding: 15px;
  }
}