/* ==========================================================================
   BİZ - Sevgili Sitesi | CSS Stylesheet
   Mobile-First, Modern, Romantic & Warm Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --color-bg: #F6F0E8;
  --color-card: #FDFAF5;
  --color-beige: #F0E8DC;
  --color-terracotta: #B9826D;
  --color-terracotta-dark: #A06B57;
  --color-rose: #D4A5A5;
  --color-sage: #A7A58F;
  --color-brown: #3D2B1F;
  --color-brown-light: #6E5343;
  --color-text-muted: #8C7565;
  --color-border: #E8DEC8;
  --color-white: #FFFFFF;

  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --shadow-sm: 0 2px 8px rgba(61, 43, 31, 0.04);
  --shadow-md: 0 4px 16px rgba(61, 43, 31, 0.08);
  --shadow-lg: 0 8px 30px rgba(61, 43, 31, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --bottom-nav-height: 68px;
  --header-height: 60px;
  --sidebar-width: 260px;
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-brown);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .font-serif {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-brown);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 0.75rem;
}
p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-terracotta);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--color-terracotta-dark);
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: rgba(246, 240, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.brand-logo {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-brown);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo .heart {
  color: var(--color-terracotta);
  font-size: 1.2rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-brown-light);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--color-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-top: var(--header-height);
  margin-bottom: calc(var(--bottom-nav-height) + 1rem);
  padding: 1.25rem 1rem;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Navigation - Mobile Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: rgba(253, 250, 245, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(61, 43, 31, 0.05);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  gap: 0.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
}

.nav-item .icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--color-terracotta);
  font-weight: 600;
}

.nav-item.active .icon {
  transform: translateY(-2px);
}

/* Slide-out Drawer Menu ("Tüm Menü") */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(61, 43, 31, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-menu {
  position: fixed;
  top: 0;
  right: -320px;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background-color: var(--color-card);
  z-index: 210;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.drawer-menu.open {
  right: 0;
}

.drawer-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-beige);
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--color-brown);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-brown);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 50%;
}

.drawer-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--color-brown);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.1s ease;
}

.drawer-link:active {
  background-color: var(--color-beige);
  transform: scale(0.98);
}

.drawer-link .icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
}

.drawer-link.logout {
  color: #C0392B;
  margin-top: 1rem;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  padding-top: 1rem;
}

/* Cards & Components */
.card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.card-interactive:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--color-brown);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}

.btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-primary {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(185, 130, 109, 0.3);
}

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

.btn-secondary {
  background-color: var(--color-beige);
  color: var(--color-brown);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: #E6DCB9;
}

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

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

.btn-danger {
  background-color: #D9534F;
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-brown-light);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  color: var(--color-brown);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(185, 130, 109, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.badge-terracotta { background-color: rgba(185, 130, 109, 0.15); color: var(--color-terracotta); }
.badge-rose { background-color: rgba(212, 165, 165, 0.2); color: #B35858; }
.badge-sage { background-color: rgba(167, 165, 143, 0.25); color: #5C5A42; }
.badge-brown { background-color: rgba(61, 43, 31, 0.1); color: var(--color-brown); }

/* Flash Notifications */
.flash-messages {
  margin-bottom: 1rem;
}

.flash-message {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.flash-success { background-color: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.flash-error { background-color: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.flash-info { background-color: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }

/* Dashboard Specifics */
.relationship-timer-card {
  background: linear-gradient(135deg, var(--color-card) 0%, var(--color-beige) 100%);
  border: 1.5px solid var(--color-border);
  text-align: center;
  padding: 1.75rem 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.timer-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--color-brown);
  letter-spacing: 1px;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.timer-box {
  background-color: var(--color-white);
  padding: 0.75rem 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.timer-number {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-terracotta);
  line-height: 1;
}

.timer-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Feed & Notes */
.note-item {
  position: relative;
  padding-left: 1rem;
  border-left: 3px solid var(--color-terracotta);
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.note-author {
  font-weight: 600;
  color: var(--color-brown);
}

/* Timeline / Hikayemiz */
.timeline {
  position: relative;
  padding-left: 1.75rem;
  margin-top: 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-rose);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 0.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--color-terracotta);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-terracotta);
}

.timeline-content {
  background-color: var(--color-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-terracotta);
  margin-bottom: 0.2rem;
}

/* Letter Paper Styling */
.letter-paper {
  background-color: #FFFDF9;
  border: 1px solid var(--color-border);
  box-shadow: 0 6px 20px rgba(61, 43, 31, 0.06);
  padding: 2rem 1.5rem;
  border-radius: var(--radius-sm);
  background-image: linear-gradient(#F3EDE2 1px, transparent 1px);
  background-size: 100% 1.8rem;
  line-height: 1.8rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #2D2118;
}

/* Media Grid / Gallery */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .media-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.media-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-beige);
  border: 1px solid var(--color-border);
}

.media-card img, .media-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem;
  background: linear-gradient(to top, rgba(61, 43, 31, 0.75), transparent);
  color: white;
  font-size: 0.8rem;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
}

.calendar-day-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 0.4rem 0;
}

.calendar-day-cell {
  aspect-ratio: 1 / 1;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.82rem;
  position: relative;
}

.calendar-day-cell.today {
  border: 2px solid var(--color-terracotta);
  background-color: rgba(185, 130, 109, 0.08);
}

.event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-terracotta);
  margin-top: 2px;
}

/* Modal Window */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 43, 31, 0.45);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: var(--color-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

/* Filters bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.filter-chip {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-brown-light);
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.active {
  background-color: var(--color-terracotta);
  color: white;
  border-color: var(--color-terracotta);
}

/* Desktop Responsive Layout */
@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }

  .app-container {
    flex-direction: row;
  }

  .app-header {
    display: none;
  }

  .desktop-sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-card);
    border-right: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 100;
  }

  .main-content {
    margin-left: var(--sidebar-width);
    margin-top: 0;
    margin-bottom: 2rem;
    max-width: 900px;
    padding: 2.5rem 2rem;
  }

  .drawer-overlay, .drawer-menu {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .desktop-sidebar {
    display: none;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
