:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --danger: #f72585;
  --success: #4cc9f0;
  --warning: #f8961e;
  --info: #577590;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --gray-light: #e9ecef;
  --white: #ffffff;
  --black: #000000;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.2);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: #f5f7fa;
  color: var(--dark);
  line-height: 1.6;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Auth styles */
.auth-container {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background-color: var(--light);
}

.auth-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.auth-logo {
  margin-bottom: 1.5rem;
}

.auth-logo img {
  height: 60px;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark);
}

.auth-subtitle {
  color: var(--gray);
  margin-bottom: 2rem;
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.auth-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

.auth-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.auth-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
}

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

.auth-footer {
  margin-top: 1.5rem;
  color: var(--gray);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Layout styles */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--white);
  box-shadow: var(--shadow);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--gray-light);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
}

.sidebar-logo img {
  height: 32px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--gray);
  text-decoration: none;
  transition: var(--transition);
}

.sidebar-link:hover {
  background-color: var(--gray-light);
  color: var(--dark);
}

.sidebar-link.active {
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--primary);
  border-right: 3px solid var(--primary);
}

.sidebar-link i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-light);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.user-email {
  font-size: 0.75rem;
  color: var(--gray);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.navbar {
  background-color: var(--white);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.navbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
}

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

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--gray-light);
  color: var(--dark);
}

.btn-outline:hover {
  background-color: var(--gray-light);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  border: none;
}

.btn-danger:hover {
  background-color: #e3176a;
}

.content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* File browser styles */
.file-browser {
  background-color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.file-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th {
  text-align: left;
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--gray);
  background-color: var(--gray-light);
}

.file-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-light);
}

.file-table tr:last-child td {
  border-bottom: none;
}

.file-table tr:hover td {
  background-color: rgba(67, 97, 238, 0.05);
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: rgba(67, 97, 238, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.file-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-actions-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-badge {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--gray-light);
  color: var(--gray);
}

.file-badge.public {
  background-color: rgba(76, 201, 240, 0.1);
  color: var(--success);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background-color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  padding: 0.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Admin styles */
.admin-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark);
}

/* Storage indicator */
.storage-indicator {
  margin-top: 1.5rem;
}

.storage-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.storage-bar {
  height: 8px;
  background-color: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
}

.storage-progress {
  height: 100%;
  background-color: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Responsive styles */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0;
  }

  .sidebar-link {
    white-space: nowrap;
  }

  .file-table {
    display: block;
    overflow-x: auto;
  }
}

/* Footer styles */
.app-footer {
  background-color: var(--white);
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--gray-light);
}

.footer-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.footer-text {
  color: var(--gray);
  font-size: 0.875rem;
}

/* File editor styles */
.editor-container {
  background-color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.editor-toolbar {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.editor-content {
  padding: 1.5rem;
}

.text-editor {
  width: 100%;
  min-height: 400px;
  padding: 1rem;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
}

.spreadsheet {
  width: 100%;
  border-collapse: collapse;
}

.spreadsheet th, .spreadsheet td {
  border: 1px solid var(--gray-light);
  padding: 0.5rem;
  min-width: 100px;
}

.spreadsheet th {
  background-color: var(--gray-light);
  font-weight: 600;
}

.spreadsheet input {
  width: 100%;
  border: none;
  padding: 0.25rem;
  font-family: inherit;
}

.spreadsheet input:focus {
  outline: none;
  background-color: rgba(67, 97, 238, 0.1);
}

.pdf-editor {
  width: 100%;
  min-height: 500px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm);
  background-color: white;
  position: relative;
}

.pdf-page {
  width: 100%;
  height: 100%;
  background-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  position: relative;
}

.pdf-element {
  position: absolute;
  border: 1px dashed transparent;
}

.pdf-element:hover {
  border-color: var(--primary);
}

.pdf-element.selected {
  border-color: var(--primary);
  background-color: rgba(67, 97, 238, 0.1);
}

.pdf-text-element {
  padding: 0.5rem;
  cursor: move;
}

.pdf-image-element {
  overflow: hidden;
}

.pdf-image-element img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdf-toolbox {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdf-toolbox button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--white);
  border: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.pdf-toolbox button:hover {
  background-color: var(--gray-light);
}

.pdf-properties {
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  padding: 1rem;
  z-index: 10;
  width: 250px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--dark);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background-color: var(--success);
}

.toast.error {
  background-color: var(--danger);
}

.toast.warning {
  background-color: var(--warning);
}

.toast-icon {
  font-size: 1.25rem;
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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