/* Overlay background */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s;
    padding: 3rem; /* Changed from 1rem to 3rem */
  }

  
  .modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }
  
  .modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    margin: auto; /* Center the modal content */
    animation: slideIn 0.3s;
    max-height: calc(100vh - 6rem); /* Updated to account for 3rem padding on top and bottom */
    display: flex; /* Added to enable flex column layout */
    flex-direction: column; /* Added to stack header and body */
  }
  
  .modal-header {
    padding: 0.5rem 2rem;
    border-bottom: 1px solid #eee;
    position: sticky; /* Added to keep header fixed */
    top: 0;
    background: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .modal-body {
    padding: 0.5rem 2rem 1rem 2rem; /* Reduced bottom padding since actions moved to footer */
    overflow-y: auto; /* This will make only the body scroll */
    flex: 1; /* Added to allow body to take remaining space */
  }
  
  .modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #eee;
    background: white;
    border-radius: 0 0 8px 8px;
    position: sticky;
    bottom: 0;
  }
  
  .form-group {
    margin-bottom: 1.5rem;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
  }
  
  .form-group input:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
  }
  
  .form-group textarea {
    min-height: 100px;
    resize: vertical;
  }
  
  .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0; /* Change this from 2rem to 0 */
    justify-content: flex-end; /* Add this line to move buttons to the right */
  }
  
  .save-btn,
  .cancel-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .save-btn {
    background: var(--primary-color);
    color: white;
    border: none;
  }
  
  .save-btn:hover {
    background: #247347;
  }
  
  .cancel-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
  }
  
  .cancel-btn:hover {
    background: #eee;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
  }

  
@media screen and (max-width: 480px) {
  .modal {
    padding: 1rem;
  }
  .modal-content {
    width: 100%;
  }
}

@media screen and (max-width: 375px) {
  .modal {
    padding: 0rem;
  }
}

@media screen and (max-width: 768px) {
  .modal {
    padding: 1rem;
  }
  .modal-content {
    width: 100%;
  }
}

  
  
  