/* =========================== */
/* Global */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
body {
  margin: 0;
  background: linear-gradient(135deg, #f0f4f8, #e2e8f0);
  color: #111827;
  line-height: 1.6;
  font-size: 16px;
  transition: background 0.3s ease;
}

/* =========================== */
/* Login Section */
#loginSection {
  text-align: center;
  margin: 15vh auto;
  padding: 1rem;
}

#googleSignInBtn {
  background: linear-gradient(135deg, #4285f4, #3367d6);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}
#googleSignInBtn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.auth-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background-color: #0ea5e9;
  color: white;
  font-weight: 500;
  text-align: center;
  transition: opacity 0.5s ease;
  opacity: 0;
}

.auth-message.visible {
  opacity: 1;
}

/* =========================== */
/* App UI */
header {
  background: rgba(30, 41, 59, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #f9fafb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

header span {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

header button {
  background: #ef4444;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  color: white;
  font-weight: 500;
  transition: background 0.3s ease;
}

header button:hover {
  background: #dc2626;
}

nav {
  background: #334155;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  flex-wrap: wrap;
}

nav button {
  background: #475569;
  color: white;
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

nav button:hover {
  background: #64748b;
}

/* =========================== */
/* Tab Sections */
.tab-section {
  padding: 1rem;
}

.hidden {
  display: none;
}

/* =========================== */
/* Year Buttons */
#yearButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#yearButtons button {
  background: #e2e8f0;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

#yearButtons button:hover {
  background: #cbd5e1;
}

/* =========================== */
/* Search Input */
#searchInput {
  width: 100%;
  max-width: 400px;
  margin: 0.5rem 0 1rem 0;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-size: 1rem;
  transition: all 0.3s ease;
}
#searchInput:focus {
  outline: none;
  box-shadow: 0 6px 18px rgba(59,130,246,0.3);
}

/* =========================== */
/* PDF and Recent Items */
.pdf-item,
.recent-item {
  background: white;
  margin: 0.5rem 0;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(203,213,225,0.5);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}
.pdf-item:hover,
.recent-item:hover {
  background: #f1f5f9;
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

.pdf-item,
.recent-item,
#yearButtons button,
nav button,
header button {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

#yearButtons button:hover,
nav button:hover,
header button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
/* =========================== */
/* Responsive Design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  nav {
    gap: 0.3rem;
  }

  #yearButtons button {
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
  }
  .pdf-item,
  .recent-item {
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
  }

  #searchInput {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
 #yearButtons button {
    flex: 1 1 100%;
  }
  nav button {
    flex: 1 1 45%;
    margin-bottom: 0.3rem;
  }

  .pdf-item,
  .recent-item {
    font-size: 0.9rem;
  }
}

/* =========================== */
/* Upload Section */
.upload-container {
  max-width: 600px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: #334155;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="file"] {
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-group input[type="file"] {
  cursor: pointer;
  padding: 0.5rem;
}

.upload-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.upload-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.3);
}

.upload-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.upload-status {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
}

.upload-status .error {
  color: #dc2626;
  background: #fee2e2;
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 4px solid #dc2626;
}

.upload-status .success {
  color: #059669;
  background: #d1fae5;
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 4px solid #059669;
}

.upload-status .info {
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.upload-instructions {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.upload-instructions pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.upload-instructions code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.upload-instructions p {
  margin: 0.75rem 0;
}

@media (max-width: 768px) {
  .upload-container {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .upload-instructions pre {
    font-size: 0.8rem;
    padding: 0.75rem;
  }
}
