/* Base Styles */
:root {
  --primary-color: #33C3F0;
  --primary-dark: #2980b9;
  --secondary-color: #1A1F2C;
  --accent-color: #8E9196;
  --text-color: #333333;
  --text-light: #666666;
  --background-color: #F7F7F8;
  --card-bg: #FFFFFF;
  --border-color: #E5E5E5;
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --hover-bg: #F1F5F9;
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--background-color);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select {
  font-family: inherit;
}

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--card-bg);
  border-right: 1px solid var(--border-color);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.logo span {
  color: var(--primary-color);
}

.logo-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: 6px;
  position: relative;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  background-color: white;
  transform: translate(-50%, -50%);
  clip-path: polygon(0 0, 60% 0, 100% 50%, 60% 100%, 0 100%, 40% 50%);
}

.sidebar-nav {
  padding: 20px 0;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
}

.sidebar-nav li {
  margin-bottom: 5px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: var(--text-light);
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sidebar-nav a:hover {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

.sidebar-nav a.active {
  background-color: rgba(51, 195, 240, 0.1);
  color: var(--primary-color);
}

.nav-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 12px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.7;
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
}

.key-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2333C3F0' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z' /%3E%3C/svg%3E");
}

.usage-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2333C3F0' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z' /%3E%3C/svg%3E");
}

.logs-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2333C3F0' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z' /%3E%3C/svg%3E");
}

.settings-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2333C3F0' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z' /%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z' /%3E%3C/svg%3E");
}

.help-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2333C3F0' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z' /%3E%3C/svg%3E");
}

.nav-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 10px 20px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Top Bar */
.top-bar {
  height: var(--topbar-height);
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.project-selector {
  position: relative;
}

.selected-project {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
}

.selected-project:hover {
  background-color: var(--hover-bg);
}

.dropdown-icon {
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23333333' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.project-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 200px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
  display: none;
  z-index: 10;
}

.project-dropdown.active {
  display: block;
}

.project-dropdown ul {
  padding: 5px 0;
}

.project-dropdown li {
  padding: 8px 12px;
  cursor: pointer;
}

.project-dropdown li:hover {
  background-color: var(--hover-bg);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

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

.user-profile {
  margin-left: 10px;
}

.profile-icon {
  width: 32px;
  height: 32px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Content Area */
.content-area {
  padding: 20px;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.page-header p {
  color: var(--text-light);
}

.content-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-content {
  padding: 20px;
}

/* Buttons */
.primary-button {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

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

.secondary-button {
  background-color: var(--hover-bg);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

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

.icon-button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.icon-button:hover {
  background-color: var(--hover-bg);
  opacity: 1;
}

.copy-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23333333' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z' /%3E%3C/svg%3E");
}

.reveal-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23333333' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z' /%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z' /%3E%3C/svg%3E");
}

.delete-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23333333' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16' /%3E%3C/svg%3E");
}

.expand-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23333333' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5l7 7-7 7' /%3E%3C/svg%3E");
}

/* API Keys Page */
.api-key-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.api-key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.key-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.key-value {
  font-family: monospace;
  color: var(--text-light);
  margin-bottom: 5px;
}

.key-meta {
  font-size: 0.8rem;
  color: var(--accent-color);
}

.key-actions {
  display: flex;
  gap: 5px;
}

.security-settings, .log-settings {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.setting-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.setting-info p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

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

/* Usage Page */
.usage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.usage-metric h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.metric-limit {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

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

.usage-progress {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 4px;
}

.time-filter select, .endpoint-filter select {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--card-bg);
}

.usage-chart {
  margin-bottom: 30px;
}

.chart-placeholder {
  height: 200px;
  position: relative;
}

.chart-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 180px;
  padding: 0 10px;
}

.chart-bar {
  width: 30px;
  background-color: var(--primary-color);
  border-radius: 4px 4px 0 0;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 10px;
}

.chart-labels span {
  font-size: 0.8rem;
  color: var(--text-light);
}

.usage-table table, .billing-history table {
  width: 100%;
  border-collapse: collapse;
}

.usage-table th, .usage-table td, .billing-history th, .billing-history td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.usage-table th, .billing-history th {
  font-weight: 600;
  color: var(--text-light);
}

.status-paid {
  color: var(--success-color);
  font-weight: 500;
}

/* Logs Page */
.search-filter {
  display: flex;
  gap: 10px;
}

.search-filter input {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 200px;
}

.logs-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

.logs-table th, .logs-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.logs-table th {
  font-weight: 600;
  color: var(--text-light);
}

.status-success {
  color: var(--success-color);
  font-weight: 500;
}

.status-warning {
  color: var(--warning-color);
  font-weight: 500;
}

.status-error {
  color: var(--error-color);
  font-weight: 500;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.pagination-button {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--card-bg);
  transition: all 0.2s ease;
}

.pagination-button:hover:not([disabled]) {
  background-color: var(--hover-bg);
}

.pagination-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 992px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
  }
  
  .sidebar-nav a span:not(.nav-icon) {
    display: none;
  }
  
  .main-content {
    margin-left: 60px;
  }
  
  .logo h1 {
    display: none;
  }
  
  .sidebar-header {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }
  
  .project-selector {
    margin-bottom: 10px;
  }
  
  .setting-item, .api-key-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .setting-control, .key-actions {
    margin-top: 10px;
  }
  
  .logs-controls {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .search-filter {
    flex-direction: column;
    width: 100%;
  }
  
  .search-filter input, .search-filter select {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .usage-summary {
    grid-template-columns: 1fr;
  }
  
  .logs-table {
    overflow-x: auto;
  }
  
  .card-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}