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

:root {
  --primary: #1a4d9e;
  --primary-dark: #0d2d5e;
  --primary-light: #2563eb;
  --text: #1a1a1a;
  --text-light: #666;
  --bg: #f5f5f5;
  --white: #ffffff;
  --border: #e0e0e0;
  --success: #10b981;
  --error: #ef4444;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Splash Screen */
.splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: splash-fade-out 0.4s ease-in 2.3s forwards;
}

.splash-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: splash-zoom-out 2.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes splash-zoom-out {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes splash-fade-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* App Container */
.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  max-width: 100vw;
  overflow: hidden;
}

/* Top Bar */
.top-bar {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.top-bar-left, .top-bar-right {
  display: flex;
  gap: 12px;
}

.logo-avatar {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  padding: 4px;
  flex-shrink: 0;
  object-fit: contain;
}

.top-bar-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.icon-btn:active {
  background: rgba(255,255,255,0.2);
}

/* Feed */
.feed {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.feed::-webkit-scrollbar {
  width: 4px;
}

.feed::-webkit-scrollbar-track {
  background: transparent;
}

.feed::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 2px;
}

/* Cards */
.card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.card-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.card-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  padding: 24px 16px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.card-solid {
  min-height: 120px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-solid .card-content {
  padding: 0;
  text-align: center;
}

.card-action-btn {
  position: relative;
  z-index: 3;
  align-self: center;
  background: var(--white);
  color: var(--primary);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
  margin-bottom: 12px;
  transition: background 0.2s, transform 0.2s;
}

.card-action-btn:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.9);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  z-index: 500;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 499;
}

.modal-content {
  background: var(--white);
  width: 100%;
  max-height: 90vh;
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modal-slide-up 0.3s ease-out;
}

@keyframes modal-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.modal-header h2 {
  font-size: 20px;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:active {
  background: var(--bg);
  border-radius: 6px;
}

/* Form */
.form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 77, 158, 0.1);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input {
  margin: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

/* Button */
.btn {
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:active {
  background: var(--primary-dark);
}

/* Message */
.message {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
}

.message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid var(--error);
}

/* Responsive */
@media (min-width: 768px) {
  .modal-content {
    max-width: 500px;
    border-radius: 16px;
    margin: auto;
  }

  .feed {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }
}
