/* src/components/Admin/AdminPanel.css */
.admin-panel {
    font-family: "articulat-cf", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text);
    background-color: var(--background);
    transition: color 0.3s ease, background-color 0.3s ease;
  }
  
  /* Header */
  .admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    margin-top: 20px;
  }
  
  .admin-header h1 {
    margin: 0;
    color: var(--button-bg);
    font-size: 1.9em;
    font-weight: 800;
  }
  
  /* Container layout */
  .admin-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: 133.0vh;
  }
  
  /* Resources sidebar */
  .resources-sidebar {
    flex-direction: column;
    height: 93.8%;
    overflow: hidden;
    padding: 10px;
    background: var(--navbar-bg);
    border: 5px solid var(--card-border);
    border-radius: 12px;
    box-shadow: none;
  }
  
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--navbar-bg);
    border-bottom: 1px solid var(--card-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
  }
  
  .sidebar-filters {
    padding: 10px 0px;
    border-bottom: 1px solid var(--card-border);
    background-color: var(--navbar-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .filter-group {
    margin-bottom: 8px;
  }
  
  .search-input {
    background-color: var(--navbar-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    padding: 8px;
    transition: all .3s ease;
    width: 100%;
    margin: 0px;
    display: flex;
  }
  
  .search-input:hover,
  .search-input:focus {
    border-color: var(--button-bg);
    background-color: var(--background);
  }
  
  .status-filter,
  .completeness-filter {
    width: 49%;
    padding: 6px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-size: 13px;
    margin-right: 2%;
    background-color: var(--navbar-bg);
    color: var(--text);
    transition: all 0.3s ease;
  }
  
  .status-filter:hover,
  .completeness-filter:hover,
  .status-filter:focus,
  .completeness-filter:focus {
    border-color: var(--button-bg);
    background-color: var(--background);
  }
  
  .completeness-filter {
    margin-right: 0;
  }
  
  .resources-list {
    overflow-y: auto;
    flex-grow: 1;
  }
  
  .resource-item {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-bottom: 1px solid var(--card-border);
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    color: var(--text);
  }
  
  .resource-completeness-indicator {
    height: 3px;
    width: 100%;
    background-color: var(--card-border);
  }
  
  .completeness-bar {
    height: 100%;
    background-color: #52c41a;
    transition: width 0.3s;
  }
  
  .resource-item-content {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
  }
  
  .resource-item:hover {
    background-color: var(--background);
  }
  
  .resource-item.selected {
    background-color: rgba(59, 154, 248, 0.1);
    border-left: 3px solid var(--button-bg);
  }
  
  .resource-item.status-draft .completeness-bar {
    background-color: #faad14;
  }
  
  .resource-item.status-review .completeness-bar {
    background-color: #1890ff;
  }
  
  .resource-item.status-published .completeness-bar {
    background-color: #52c41a;
  }
  
  .resource-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
  }
  
  .resource-item-meta {
    display: flex;
    gap: 5px;
    font-size: 12px;
    margin-top: 4px;
  }
  
  .status-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
  }
  
  .status-badge.status-draft {
    background-color: rgba(250, 173, 20, 0.2);
    color: #faad14;
    border: 1px solid #faad14;
  }
  
  .status-badge.status-review {
    background-color: rgba(24, 144, 255, 0.2);
    color: #1890ff;
    border: 1px solid #1890ff;
  }
  
  .status-badge.status-published {
    background-color: rgba(82, 196, 26, 0.2);
    color: #52c41a;
    border: 1px solid #52c41a;
  }
  
  .featured-badge {
    background-color: rgba(114, 46, 209, 0.2);
    color: #722ed1;
    border: 1px solid #722ed1;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: bold;
  }
  
  .resource-item-actions {
    display: flex;
    gap: 5px;
    visibility: hidden;
  }
  
  .resource-item:hover .resource-item-actions {
    visibility: visible;
  }
  
  /* Resource editor */
  .resource-editor {
    color: var(--text);
    height: 92%;
    overflow-y: auto;
    padding: 20px;
    transition: background-color .3s ease,border-color .3s ease;
    background: var(--navbar-bg);
    border: 5px solid var(--card-border);
    border-radius: 12px;
    box-shadow: none;
  }
  
  .editor-header {
    margin-bottom: 20px;
  }
  
  .resource-editor input {
    margin: 0px;
  }
  
  .editor-header h2 {
    margin: 0;
    color: var(--text);
  }
  
  .floating-actions {
    display: flex;
    align-items: center;
    gap: 15px;
  }
  
  .floating-save-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    margin: 0px;
  }
  
  .floating-save-button:hover {
    background-color: #004F84;
  }
  
  .status-selector {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .status-selector span {
    font-weight: 500;
    color: var(--text);
  }
  
  .status-buttons {
    display: flex;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    overflow: hidden;
  }
  
  .status-button {
    padding: 6px 10px;
    background-color: var(--navbar-bg);
    border: none;
    border-right: 1px solid var(--card-border);
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: all 0.3s ease;
  }
  
  .status-button:last-child {
    border-right: none;
  }
  
  .status-button.active {
    background-color: var(--button-bg);
    color: var(--button-text);
  }
  
  .status-button:hover:not(.active) {
    background-color: var(--background);
  }
  
  .resource-editor h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text);
  }
  
  /* Form styling */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text);
  }
  
  .form-group input[type="text"],
  .form-group input[type="url"],
  .form-group input[type="number"],
  .form-group textarea {
    width: 100%;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--navbar-bg);
    color: var(--text);
    padding: 8px;
    transition: all 0.3s ease;
  }
  
  .form-group input[type="text"]:hover,
  .form-group input[type="url"]:hover,
  .form-group input[type="number"]:hover,
  .form-group textarea:hover,
  .form-group input[type="text"]:focus,
  .form-group input[type="url"]:focus,
  .form-group input[type="number"]:focus,
  .form-group textarea:focus {
    border-color: var(--button-bg);
    background-color: var(--background);
  }
  
  .form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: articulat-cf;
  }
  
  .checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .checkbox-group input[type="checkbox"] {
    margin: 0;
  }
  
  .checkbox-group label {
    margin-bottom: 0;
  }
  
  /* Categories and Tags sections */
  .categories-section,
  .tags-section {
    background-color: var(--background);
    border-radius: 6px;
    padding: 15px;
    border: 1px solid var(--card-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .section-header label {
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text);
  }
  
  .checkbox-list {
    max-height: 200px;
    overflow-y: auto;
  }
  
  .checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
  }
  
  .checkbox-item label {
    margin-bottom: 0;
    font-weight: normal;
    color: var(--text);
  }
  
  /* Form actions */
  .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
  }
  
  /* Buttons */
  button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s, opacity 0.2s;
  }
  
  .add-new-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
  }
  
  .add-new-button:hover {
    background-color: #004F84;
  }
  
  .delete-button {
    background: none;
    font-size: 16px;
    opacity: .7;
    padding: 3px 6px;
    margin: 0px;
    margin-left: 10px;
    margin-bottom: 10px;
  }
  
  .delete-button:hover {
    opacity: 1;
    background-color: rgba(244, 67, 54, 0.1);
  }
  
  .add-item-button {
    background-color: var(--navbar-bg);
    color: var(--text);
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
  }
  
  .add-item-button:hover {
    background-color: var(--background);
    border-color: var(--button-bg);
  }
  
  .save-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 10px 20px;
    font-weight: 700;
  }
  
  .save-button:hover {
    background-color: #004F84;
  }
  
  .cancel-button {
    background-color: var(--navbar-bg);
    color: var(--text);
    padding: 10px 20px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
  }
  
  .cancel-button:hover {
    background-color: var(--background);
    border-color: var(--button-bg);
  }
  
  .logout-button {
    background-color: var(--navbar-bg);
    color: var(--text);
    padding: 8px 16px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
    margin: 0px;
  }
  
  .logout-button:hover {
    background-color: var(--background);
    border-color: var(--button-bg);
  }
  
  /* Alert messages */
  .alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
  }
  
  .alert.success {
    background-color: rgba(82, 196, 26, 0.1);
    border: 1px solid #52c41a;
    color: #52c41a;
  }
  
  .alert.error {
    background-color: rgba(245, 34, 45, 0.1);
    border: 1px solid #f5222d;
    color: #f5222d;
  }
  
  /* Loading spinner */
  .admin-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: var(--text);
    background-color: var(--background);
  }
  
  .loading-spinner {
    border: 4px solid var(--card-border);
    border-top: 4px solid var(--button-bg);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Login form */
  .admin-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--background);
    transition: background-color 0.3s ease;
  }
  
  .admin-login-card {
    background-color: var(--navbar-bg);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 30px;
    width: 100%;
    max-width: 400px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .admin-login-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text);
  }
  
  .login-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    padding: 10px 0;
    width: 100%;
    font-size: 16px;
    margin-top: 10px;
    font-weight: 700;
  }

  .admin-container form {
    border: 0px;
    padding: 0px;
  }
  
  .login-button:hover {
    background-color: #004F84;
  }
  
  .auth-error {
    background-color: rgba(245, 34, 45, 0.1);
    border: 1px solid #f5222d;
    color: #f5222d;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
  }
  
  /* Accessibility */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
  }
  
  /* Responsive design */
  @media (max-width: 768px) {
    .admin-container {
      grid-template-columns: 1fr;
    }

    .floating-actions {
        align-items: center;
        display: flex;
        gap: 15px;
        justify-content: space-between;
        flex-direction: column;
      }

      .admin-container form {
        border: 0px;
        padding: 0px;
        align-content: center;
        display: block;
      }

      .form-group textarea {
        min-height: 100px;
        resize: vertical;
        font-family: articulat-cf;
        width: unset;
      }

      .admin-container {
        grid-gap: 20px;
        display: grid;
        gap: 20px;
        grid-template-columns: 300px 1fr;
        height: 100%;
      }

      .resource-editor {
        height: 100%;
      }
    
    .form-row {
      grid-template-columns: 1fr;
    }
  }