/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --md-primary: #1976d2;
  --md-primary-hover: #1565c0;
  --md-bg: #f4f5f7;
  --md-surface: #ffffff;
  --md-text-primary: rgba(0, 0, 0, 0.87);
  --md-text-secondary: rgba(0, 0, 0, 0.6);
  --md-divider: rgba(0, 0, 0, 0.12);
  --md-shadow-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --md-shadow-2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  --md-shadow-focus: 0 0 0 4px rgba(25, 118, 210, 0.15);
  --md-error: #b00020;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--md-bg);
  color: var(--md-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Bar */
.app-bar {
  background: linear-gradient(135deg, var(--md-primary) 0%, #0d47a1 100%);
  color: white;
  padding: 2rem 1rem 4rem;
  box-shadow: var(--md-shadow-2);
}

.app-bar-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.app-bar h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.app-bar p {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Container */
.container {
  max-width: 800px;
  margin: -3rem auto 2rem;
  padding: 0 1rem;
}

/* Cards */
.card {
  background-color: var(--md-surface);
  border-radius: 12px;
  box-shadow: var(--md-shadow-1);
  padding: 24px;
  transition: box-shadow 0.3s cubic-bezier(.25, .8, .25, 1);
}

.card:hover {
  box-shadow: var(--md-shadow-2);
}

.compose-card {
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
}

/* Input Styles */
#memo-form {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.input-group {
  position: relative;
  flex: 1;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--md-divider);
  border-radius: 8px;
  background-color: #fafafa;
  outline: none;
  transition: all 0.2s ease;
  color: var(--md-text-primary);
}

.input-group input:hover {
  background-color: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.24);
}

.input-group input:focus {
  background-color: var(--md-surface);
  border-color: var(--md-primary);
  box-shadow: var(--md-shadow-focus);
}

.floating-label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--md-text-secondary);
  pointer-events: none;
  transition: 0.2s ease all;
  font-size: 1rem;
  background-color: transparent;
  padding: 0 4px;
}

.input-group input:focus~.floating-label,
.input-group input:not(:placeholder-shown)~.floating-label {
  top: 0;
  transform: translateY(-50%);
  left: 12px;
  font-size: 0.75rem;
  color: var(--md-primary);
  background-color: var(--md-surface);
  font-weight: 500;
}

/* Buttons */
.actions {
  display: flex;
  justify-content: flex-end;
}

.md-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
  outline: none;
  font-family: inherit;
}

.md-btn:active {
  transform: translateY(1px);
}

.md-btn-primary {
  background-color: var(--md-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
}

.md-btn-primary:hover {
  background-color: var(--md-primary-hover);
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.4);
}

.md-btn-primary:disabled {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.38);
  box-shadow: none;
  cursor: not-allowed;
}

/* Ripple Animation */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Memo Section */
.section-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--md-text-primary);
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.memo-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.memo-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-left: 4px solid var(--md-primary);
  animation: slideUp 0.4s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animations for list items */
.memo-card:nth-child(1) {
  animation-delay: 0.1s;
}

.memo-card:nth-child(2) {
  animation-delay: 0.15s;
}

.memo-card:nth-child(3) {
  animation-delay: 0.2s;
}

.memo-card:nth-child(4) {
  animation-delay: 0.25s;
}

.memo-card:nth-child(5) {
  animation-delay: 0.3s;
}

.memo-content {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.memo-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.memo-date {
  font-size: 0.8rem;
  color: var(--md-text-secondary);
  background-color: rgba(0, 0, 0, 0.04);
  padding: 4px 8px;
  border-radius: 4px;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--md-text-secondary);
  background-color: transparent;
  border: 2px dashed var(--md-divider);
  border-radius: 12px;
  font-size: 1.1rem;
}

.empty-state.error {
  color: var(--md-error);
  border-color: rgba(176, 0, 32, 0.3);
  background-color: rgba(176, 0, 32, 0.05);
}

/* Responsive */
@media (max-width: 600px) {
  .app-bar {
    padding: 1.5rem 1rem 3.5rem;
  }

  .app-bar h1 {
    font-size: 2rem;
  }

  .container {
    margin-top: -2.5rem;
  }
}
/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-btn {
  padding: 8px 16px;
  border: 1px solid var(--md-divider);
  background: var(--md-surface);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--md-text-primary);
}

.page-btn:hover:not(:disabled) {
  background: #f5f5f5;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.9rem;
  color: var(--md-text-secondary);
}
