:root {
  --primary: #000000;
  --primary-dark: #0fb441;
  --primary-light: #3c5876;
  --secondary: #f5f5ff;
  --success: #34c759;
  --danger: #ff3b30;
  --warning: #ff9500;
  --dark: #1d1d1f;
  --dark-light: #424245;
  --light: #f5f5f7;
  --light-gray: #d2d2d7;
  --border: #d2d2d7;
  --text: #1d1d1f;
  --text-light: #86868b;
  --gradient: linear-gradient(135deg, #cd1c18 0%, #ff0000 100%);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.logo svg {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.user-session {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  font-weight: 600;
  color: var(--dark);
}

.btn-logout {
  padding: 0.4rem 0.8rem;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.btn-logout:hover {
  background: #cc2e24;
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  background: var(--gradient);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(90deg, #6cc500, #6cc500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.feature-badge {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main {
  flex: 1;
  padding: 3rem 0;
}

.section {
  margin-bottom: 3rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-light);
  font-size: 1.125rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--light);
}

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
}

.card-body {
  padding: 1.5rem;
}

/* Forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 500;
  color: var(--dark);
  font-size: 0.875rem;
}

.form-input,
.form-input-sm {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
}

.form-input-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.form-input:focus,
.form-input-sm:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* File Input */
.file-input-wrapper {
  position: relative;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--light);
}

.file-input-label:hover {
  border-color: var(--primary);
  background: rgba(0, 122, 255, 0.05);
}

.file-input-label svg {
  width: 24px;
  height: 24px;
  color: var(--text-light);
}

/* Buttons */
.btn,
.btn-sm {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-primary {
  background: #000000;
  color: white;
  box-shadow: 0 2px 8px rgba(248, 228, 0, 0.2);
}

.btn-primary:hover {
  background: #56de2c;
  transform: translateY(-2px);
}

#loginBtn {
  background: #000000;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#loginBtn:hover {
  background: #56de2c;
  transform: translateY(-2px);
}

#loginBtn:active {
  transform: translateY(-1px);
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.btn-icon:hover {
  color: var(--primary);
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

/* Results */
.result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  display: none;
}

.result.show {
  display: block;
}

.result.success {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.result.error {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

/* Users List */
.users-list {
  display: grid;
  gap: 1rem;
}

.user-card {
  padding: 1rem;
  background: var(--light);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.user-card:hover {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-name {
  font-weight: 600;
  color: var(--dark);
}

.user-id {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Files List */
.files-list {
  display: grid;
  gap: 1rem;
}

.file-card {
  padding: 1rem;
  background: var(--light);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-name {
  font-weight: 600;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-shared {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, #ffe600 0%, #ffe600 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-meta {
  font-size: 0.875rem;
  color: var(--text-light);
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-download {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

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

/* Blockchain */
.blockchain-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.status-card {
  padding: 1rem;
  background: var(--light);
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.status-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.status-label {
  font-size: 0.875rem;
  color: var(--text-light);
}

.blockchain-blocks {
  display: grid;
  gap: 1rem;
}

.block-card {
  padding: 1.5rem;
  background: var(--light);
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--primary);
}

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

.block-index {
  font-weight: 700;
  color: var(--primary);
}

.block-timestamp {
  font-size: 0.875rem;
  color: var(--text-light);
}

.block-data {
  display: grid;
  gap: 0.5rem;
}

.block-field {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.block-label {
  font-weight: 600;
  color: var(--text-light);
}

.block-value {
  color: var(--dark);
  word-break: break-all;
}

/* Footer */
.footer {
  background: var(--dark);
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-text p {
  opacity: 0.8;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 1;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .nav {
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .blockchain-status {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.empty-state p {
  font-size: 0.875rem;
}

/* 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.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #ffffff;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 90%;
  max-width: 500px;
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--light);
  color: var(--dark);
}

.modal-body {
  padding: 1.5rem;
}

.modal-search-container {
  margin-bottom: 1.5rem;
  position: relative;
}

.modal-search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s;
  outline: none;
  background: var(--light);
}

.modal-search-input:focus {
  border-color: #000000;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.modal-search-input::placeholder {
  color: var(--text-light);
}

.modal-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.login-users-list {
  display: grid;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.login-users-list::-webkit-scrollbar {
  width: 8px;
}

.login-users-list::-webkit-scrollbar-track {
  background: var(--light);
  border-radius: 4px;
}

.login-users-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.login-users-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.login-user-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-user-card:hover {
  border-color: var(--primary);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.05),
    rgba(168, 85, 247, 0.05)
  );
  transform: translateY(-2px);
}

.login-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.login-user-name {
  font-weight: 600;
  color: var(--dark);
}

.login-user-id {
  font-size: 0.875rem;
  color: var(--text-light);
}

.btn-login-select {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: rgb(138, 138, 138);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login-select:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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