/* Edge FileSystem Dashboard Styles */

:root {
  --primary: #0066FF;
  --primary-hover: #0052CC;
  --secondary: #64748B;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text-main);
  font-size: 24px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-main);
}

.login-form input,
.login-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.login-form input:focus,
.login-form select:focus {
  outline: none;
  border-color: var(--primary);
}

.login-form button {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-form button:hover {
  background: var(--primary-hover);
}

.login-form .error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
}

/* Dashboard */
.dashboard {
  min-height: 100vh;
  background: var(--bg-main);
}

.dashboard-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-header h1 {
  font-size: 20px;
  color: var(--text-main);
}

.dashboard-header .user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard-header .user-name {
  color: var(--text-muted);
  font-size: 14px;
}

.dashboard-header button {
  padding: 8px 16px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.dashboard-header button:hover {
  background: var(--border);
}

/* Tabs */
.tabs {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 24px;
}

.tab {
  padding: 16px 0;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Content */
.content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-main);
}

/* File Browser */
.file-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.file-controls select,
.file-controls input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.file-controls button {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.file-controls button:hover {
  background: var(--primary-hover);
}

.file-controls button.secondary {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.file-controls button.secondary:hover {
  background: var(--border);
}

.file-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item:hover {
  background: var(--bg-main);
}

.file-icon {
  font-size: 24px;
  margin-right: 12px;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 4px;
}

.file-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.file-actions {
  display: flex;
  gap: 8px;
}

.file-actions button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.file-actions .btn-download {
  background: var(--success);
  color: white;
  border: none;
}

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

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  margin-top: 20px;
  transition: all 0.2s;
}

.upload-area.dragover {
  border-color: var(--primary);
  background: var(--bg-main);
}

.upload-area p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upload-area button {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--text-muted);
}

.stat-chart {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.stat-chart h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-main);
}

.stat-bar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.stat-bar-label {
  flex: 0 0 100px;
  font-size: 14px;
  color: var(--text-muted);
}

.stat-bar-fill {
  flex: 1;
  height: 24px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 12px;
}

.stat-bar-value {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.stat-bar-count {
  flex: 0 0 50px;
  text-align: right;
  font-weight: 600;
  font-size: 14px;
}

/* Rate Limit */
.rate-limit-status {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.rate-limit-gauge {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}

.rate-limit-circle {
  width: 120px;
  height: 120px;
  position: relative;
}

.rate-limit-circle svg {
  transform: rotate(-90deg);
}

.rate-limit-circle .bg {
  fill: none;
  stroke: var(--bg-main);
  stroke-width: 8;
}

.rate-limit-circle .fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s;
}

.rate-limit-circle .text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.rate-limit-info p {
  margin: 8px 0;
  font-size: 14px;
}

.rate-limit-info .label {
  color: var(--text-muted);
}

.rate-limit-info .value {
  font-weight: 600;
  color: var(--text-main);
}

/* Audit Logs */
.audit-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.audit-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.audit-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-family: 'Courier New', monospace;
}

.audit-item:last-child {
  border-bottom: none;
}

.audit-item.success {
  border-left: 3px solid var(--success);
  padding-left: 13px;
}

.audit-item.failure {
  border-left: 3px solid var(--danger);
  padding-left: 13px;
}

.audit-time {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.audit-operation {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.audit-details {
  color: var(--text-muted);
  font-size: 12px;
}

/* Utility */
.hidden {
  display: none;
}

.error {
  color: var(--danger);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .tabs {
    overflow-x: auto;
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .file-controls {
    flex-direction: column;
  }

  .file-controls select,
  .file-controls input {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    padding: 12px 16px;
  }

  .dashboard-header h1 {
    font-size: 16px;
  }
}
