@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Special+Elite&display=swap');

:root {
  --manila-bg: #E3D4AD;
  --typewriter-black: #1C1C1C;
  --stamp-red: #B23A48;
  --edge-shadow: #8B7355;
  --paper-white: #F5F5F0;
  --polaroid-bg: white;
  --redacted-bg: #1C1C1C;
}

body.dark-mode {
  --manila-bg: #1A1814;
  --typewriter-black: #D4C4A8;
  --stamp-red: #FF4B5C;
  --edge-shadow: #2C2822;
  --paper-white: #262420;
  --polaroid-bg: #333;
  --redacted-bg: #555;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--manila-bg);
  color: var(--typewriter-black);
  font-family: 'Courier Prime', monospace;
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-image: url('https://www.transparenttextures.com/patterns/pinstriped-suit.png');
}

/* Redaction Effect */
.redacted {
  background-color: var(--redacted-bg);
  color: var(--redacted-bg);
  user-select: none;
}

/* Header as Folder Tabs */
.header {
  display: flex;
  padding: 0 2rem;
  background: var(--edge-shadow);
  height: 60px;
  align-items: flex-end;
  border-bottom: 3px solid var(--typewriter-black);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.header-title {
  font-family: 'Special Elite', cursive;
  font-size: 1.4rem;
  padding: 10px 20px;
  background: var(--manila-bg);
  border: 2px solid var(--typewriter-black);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  margin-right: 20px;
  box-shadow: 2px -2px 5px rgba(0, 0, 0, 0.1);
}

.header-nav {
  display: flex;
  gap: 5px;
}

.divergence-btn {
  font-family: 'Special Elite', cursive;
  background: #D4C49A;
  border: 1px solid var(--typewriter-black);
  border-bottom: none;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.divergence-btn:hover {
  background: var(--paper-white);
  transform: translateY(-2px);
}

/* Profile Content Area */
.profile-container {
  flex: 1;
  overflow-y: auto;
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
}

.profile-box {
  background: var(--paper-white);
  padding: 3rem;
  max-width: 850px;
  width: 100%;
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.1), 0 0 50px rgba(0, 0, 0, 0.05);
  position: relative;
  border: 1px solid #ddd;
  min-height: 100%;
}

/* Polaroid Photo Style */
.polaroid-frame {
  background: var(--polaroid-bg);
  padding: 15px 15px 45px 15px;
  display: inline-block;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
  transform: rotate(-2deg);
  margin-bottom: 20px;
  position: relative;
  transition: background 0.3s ease;
}

.polaroid-frame img {
  border: 1px solid #eee;
  display: block;
}

.polaroid-frame::after {
  content: "REF_NO: 571-024";
  position: absolute;
  bottom: 10px;
  left: 15px;
  font-family: 'Special Elite', cursive;
  font-size: 0.8rem;
  color: #555;
}

#username {
  font-family: 'Special Elite', cursive;
  font-size: 2.5rem;
  margin: 1rem 0;
  text-transform: uppercase;
  border-bottom: 2px solid var(--typewriter-black);
  display: inline-block;
}

#description {
  max-width: 600px;
  margin: 1.5rem auto;
  line-height: 1.6;
  font-size: 1.1rem;
  text-align: left;
  border-left: 3px solid var(--edge-shadow);
  padding-left: 1rem;
}

.date {
  font-size: 0.9rem;
  font-weight: bold;
  opacity: 0.7;
  text-align: right;
  margin-top: 1rem;
}

/* Statistics as Stamp Card */
.profile-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  padding: 2rem;
  border: 4px double var(--stamp-red);
  background: rgba(178, 58, 72, 0.03);
}

.stat {
  text-align: center;
  position: relative;
}

.stat-value {
  font-family: 'Special Elite', cursive;
  font-size: 2rem;
  color: var(--stamp-red);
  display: block;
  transform: rotate(-3deg);
}

.stat div {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Post Styling */
.post {
  background: white;
  margin-bottom: 2rem;
  padding: 2rem;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  transform: rotate(0.5deg);
}

.post::before {
  content: "FILED";
  position: absolute;
  top: 10px;
  right: 15px;
  border: 3px solid var(--stamp-red);
  color: var(--stamp-red);
  padding: 5px 10px;
  font-family: 'Special Elite', cursive;
  font-weight: 900;
  opacity: 0.4;
  transform: rotate(15deg);
  pointer-events: none;
}

.post-header {
  font-size: 0.8rem;
  border-bottom: 1px dotted #888;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: #555;
}

.post-content {
  font-family: 'Courier Prime', monospace;
  font-size: 1rem;
  line-height: 1.5;
}

/* Post Form Carriage Style */
#post-form {
  background: #fdfdfd;
  padding: 2rem;
  border: 2px solid var(--typewriter-black);
  margin: 3rem 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

#post-content {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #ccc;
  font-family: 'Courier Prime', monospace;
  font-size: 1rem;
  outline: none;
  resize: vertical;
  background-image: repeating-linear-gradient(transparent, transparent 24px, #eee 24px, #eee 25px);
  line-height: 25px;
}

#post-btn {
  background: var(--typewriter-black);
  color: white;
  border: none;
  padding: 10px 25px;
  font-family: 'Special Elite', cursive;
  cursor: pointer;
  margin-top: 1rem;
}

#post-btn:hover {
  background: #444;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: var(--paper-white);
  margin: 10% auto;
  padding: 2rem;
  border: 5px solid var(--edge-shadow);
  width: 500px;
  max-width: 90%;
}

/* Custom Scrollbar for Vintage feel */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--edge-shadow);
}

::-webkit-scrollbar-thumb {
  background: var(--typewriter-black);
  border: 3px solid var(--edge-shadow);
}

/* Theme Toggle Switch */
.theme-switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  left: 300px;
  top: 15px;
  font-family: 'Special Elite', cursive;
  font-size: 0.8rem;
  font-weight: bold;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
  border: 2px solid var(--typewriter-black);
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: var(--typewriter-black);
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--stamp-red);
}

input:checked+.slider:before {
  transform: translateX(20px);
}