/* Papaya SmartHub - Common CSS Styles */
/* Version: 1.0.0 */
/* Author: Papaya Parking */
/* Last Modified: April 29, 2025 */

/* Base Styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
}

* {
  box-sizing: border-box;
}

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

/* Sidebar Styles */
.sidebar {
  width: 220px;
  background-color: #1E2A3A;
  color: white;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: bold;
}

.sidebar-menu {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  padding: 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: white;
  text-decoration: none;
  border-left: 4px solid transparent;
}

.sidebar-menu a.active {
  background-color: rgba(255,255,255,0.1);
  border-left: 4px solid #FF8C00;
}

.sidebar-menu .icon {
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

/* Hamburger Menu Styles */
.hamburger-menu {
  display: none; /* Hidden by default on desktop */
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 2000;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 40px;
  background-color: #1E2A3A;
  border-radius: 5px;
}

.hamburger-line {
  display: block;
  height: 3px;
  width: 100%;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-header {
  display: none;
  background-color: #1E2A3A;
  color: white;
  padding: 15px 20px;
  text-align: center;
  font-weight: bold;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
}

.main-header {
  text-align: center;
  margin-top: 0;
  margin-bottom: 20px;
}

/* Card Components */
.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  margin-top: 0;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  margin: 0;
}

/* Tabs Navigation */
.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
}

.tab {
  padding: 8px 16px;
  cursor: pointer;
  color: #666;
}

.tab.active {
  font-weight: bold;
  border-bottom: 2px solid #FF8C00;
  color: #FF8C00;
}

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

/* Form Elements */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

.form-group.wide {
  flex: 2;
  min-width: 300px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.form-select, .form-input {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.form-textarea {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  min-height: 100px;
  font-family: monospace;
  resize: vertical;
}

/* Buttons */
.btn {
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}

.btn-primary {
  background-color: #FF8C00;
  color: white;
  font-weight: bold;
}

.btn-secondary {
  background-color: #eee;
  color: #333;
}

.btn-danger {
  background-color: #F44336;
  color: white;
  font-weight: bold;
}

.btn-warning {
  background-color: #FFC107;
  color: #333;
}

.btn-outline {
  border: 1px solid #FF8C00;
  color: #FF8C00;
  background-color: transparent;
  font-weight: bold;
}

/* Tables */
.logs-table, .test-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.logs-table th, .test-table th {
  text-align: left;
  padding: 12px 8px;
  background-color: #f5f5f5;
  font-weight: normal;
  color: #666;
  font-size: 14px;
}

.logs-table td, .test-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
}

.logs-table tr:hover, .test-table tr:hover {
  background-color: #f9f9f9;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.status-running {
  background-color: #4CAF5022;
  color: #4CAF50;
}

.status-idle {
  background-color: #1E88E522;
  color: #1E88E5;
}

.status-critical {
  background-color: #F4433622;
  color: #F44336;
}

.status-warning {
  background-color: #FFC10722;
  color: #FFC107;
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.badge-success {
  background-color: #4CAF5022;
  color: #4CAF50;
}

.badge-warning {
  background-color: #FFC10722;
  color: #FFC107;
}

.badge-error {
  background-color: #F4433622;
  color: #F44336;
}

/* Toggle Switches */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

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

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

input:checked + .toggle-slider {
  background-color: #FF8C00;
}

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

/* HTTP Method Colors */
.method-get {
  color: #4CAF50;
  font-weight: bold;
}

.method-post {
  color: #1E88E5;
  font-weight: bold;
}

.method-put {
  color: #FFC107;
  font-weight: bold;
}

.method-delete {
  color: #F44336;
  font-weight: bold;
}

.http-method {
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  margin-right: 12px;
  font-family: monospace;
}

.method-get {
  background-color: #E3F2FD;
  color: #1E88E5;
}

.method-post {
  background-color: #E8F5E9;
  color: #4CAF50;
}

.method-put {
  background-color: #FFF8E1;
  color: #FFC107;
}

.method-delete {
  background-color: #FFEBEE;
  color: #F44336;
}

/* Log Levels */
.log-level-info {
  background-color: #1E88E522;
  color: #1E88E5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.log-level-warning {
  background-color: #FFC10722;
  color: #FFC107;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.log-level-error {
  background-color: #F4433622;
  color: #F44336;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.log-level-debug {
  background-color: #9E9E9E22;
  color: #9E9E9E;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.page-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background-color: #eee;
  cursor: pointer;
}

.page-item.active {
  background-color: #FF8C00;
  color: white;
  font-weight: bold;
}

/* Code Blocks */
.code-block {
  font-family: monospace;
  font-size: 12px;
  background-color: #1E2A3A;
  color: white;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  margin-top: 4px;
}

.code-comment {
  color: #546E7A;
}

.code-string {
  color: #C3E88D;
}

.code-number {
  color: #F78C6C;
}

.code-boolean {
  color: #FF9800;
}

.code-null {
  color: #FFCDD2;
}

.code-key {
  color: #89DDFF;
}

/* Footer */
.footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 14px;
}

/* Search Controls */
.search-container {
  display: flex;
  margin-bottom: 20px;
}

.search-input {
  flex-grow: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 16px;
}

.search-button {
  padding: 12px 20px;
  background-color: #FF8C00;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-weight: bold;
}

/* Warning Message */
.warning-message {
  background-color: #FFF3E0;
  color: #E65100;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  border-left: 4px solid #FF8C00;
}

/* Backdrop for mobile menu */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Responsive utilities */
@media (max-width: 768px) {
  /* Mobile layout adjustments */
  .dashboard {
    flex-direction: column;
  }
  
  /* Hide sidebar by default on mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }
  
  /* When sidebar is active */
  .sidebar.active {
    transform: translateX(0);
  }
  
  /* Show hamburger menu on mobile */
  .hamburger-menu {
    display: block;
  }
  
  /* Show mobile header */
  .mobile-header {
    display: block;
  }
  
  /* Adjust main content for mobile header */
  .main-content {
    padding-top: 70px;
  }
  
  /* Show backdrop when sidebar is active */
  .sidebar-backdrop.active {
    display: block;
  }
  
  /* Form responsiveness */
  .form-row {
    flex-direction: column;
  }
  
  .form-group {
    width: 100%;
  }
  
  /* Tabs scrolling on mobile */
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
  }
}