/* static/css/form-styles.css */
/* Common styles for styled form containers (Login, Register, Upload) */

.styled-form-container {
    padding: 2rem;
    border-radius: 16px;
    margin-top: 3rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* Adjust max-width specifically for login/register if needed */
  .login-page-container { /* Apply this class in login.html */
    max-width: 450px;
  }
 .register-page-container { /* Apply this class in register.html */
    max-width: 500px;
 }
 .upload-page-container { /* Apply this class in upload.html */
    max-width: 700px; /* Make upload container more compact */
 }
  
  
  .styled-form-container:hover {
    transform: translateY(-2px);
  }
  
  /* Theme-specific backgrounds, borders, shadows */
  [data-bs-theme="light"] .styled-form-container {
    border: 1px solid rgba(109, 92, 174, 0.1); /* Subtle purple tinted border */
    background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(248, 249, 250, 0.8));
    box-shadow: 0 4px 20px rgba(109, 92, 174, 0.08);
  }
  
  [data-bs-theme="light"] .styled-form-container:hover {
    box-shadow: 0 6px 25px rgba(109, 92, 174, 0.12);
  }
  
  [data-bs-theme="dark"] .styled-form-container {
    border: 1px solid var(--bs-border-color);
    background: linear-gradient(145deg, #2f3337, #2a2e31); /* Subtle dark gradient */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  }
  
  [data-bs-theme="dark"] .styled-form-container:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  }
  
  /* Form validation states */
  .styled-form-container .was-validated .form-control:valid,
  .styled-form-container .form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    padding-right: calc(1.5em + 0.75rem);
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
  }
  
  .styled-form-container .was-validated .form-control:invalid,
  .styled-form-container .form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    padding-right: calc(1.5em + 0.75rem);
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
  }
  
  /* Style form inputs inside container */
  .styled-form-container .form-control {
    border-radius: 12px;
    transition: all 0.2s ease;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  /* Light theme form controls */
  [data-bs-theme="light"] .styled-form-container .form-control {
    border-color: rgba(109, 92, 174, 0.15);
    background: rgba(255, 255, 255, 0.9);
  }
  
  [data-bs-theme="light"] .styled-form-container .form-control:focus {
    border-color: var(--custom-primary);
    box-shadow: 0 0 0 4px rgba(109, 92, 174, 0.1);
    background: #ffffff;
  }
  
  [data-bs-theme="light"] .styled-form-container .form-control:hover {
    border-color: var(--custom-primary);
    background: #ffffff;
  }
  
  /* Dark theme form controls */
  [data-bs-theme="dark"] .styled-form-container .form-control {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
  }
  
  [data-bs-theme="dark"] .styled-form-container .form-control:focus {
    border-color: var(--custom-primary);
    box-shadow: 0 0 0 4px rgba(109, 92, 174, 0.15);
    background: rgba(0, 0, 0, 0.3);
  }
  
  [data-bs-theme="dark"] .styled-form-container .form-control:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
  }
  
  /* Button styling */
  .styled-form-container .btn-custom {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    margin-bottom: 1.5rem;
    min-width: 140px;
    position: relative;
  }
  
  /* Loading state for button */
  .styled-form-container .btn-custom.loading {
    color: transparent !important;
    pointer-events: none;
  }
  
  .styled-form-container .btn-custom.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: button-loading-spinner 0.6s linear infinite;
  }
  
  /* Links styling */
  .styled-form-container .links-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(128, 128, 128, 0.15);
    text-align: center;
  }
  
  [data-bs-theme="dark"] .styled-form-container .links-container {
    border-top-color: rgba(255, 255, 255, 0.1);
  }
  
  .styled-form-container a {
    color: var(--custom-primary);
    text-decoration: none;
    transition: all 0.2s ease;
  }
  
  .styled-form-container a:hover {
    color: var(--custom-primary-hover);
    text-decoration: underline;
  }
  
  [data-bs-theme="dark"] .styled-form-container a {
    color: rgba(255, 255, 255, 0.8);
  }
  
  [data-bs-theme="dark"] .styled-form-container a:hover {
    color: var(--custom-primary);
  }
  
  /* Form group spacing */
  .styled-form-container .form-group {
    margin-bottom: 1.25rem;
  }
  
  /* Form headings */
  .styled-form-container h3 {
    color: var(--bs-body-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
  }
  
  /* Placeholder styling */
  .styled-form-container .form-control::placeholder {
    color: var(--bs-secondary-color);
    opacity: 0.7;
    font-size: 0.95rem;
  }
  
  /* Error message styling */
  .styled-form-container .invalid-feedback {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-left: 0.25rem;
  }
  
  /* Center submit button container */
  .styled-form-container .submit-container {
    text-align: center;
    margin-top: 2rem;
  }
  
  /* Focus styles */
  .styled-form-container .form-control:focus-visible {
    outline: none;
  }
  
  .styled-form-container .btn-custom:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(109, 92, 174, 0.25);
  }
  
  [data-bs-theme="dark"] .styled-form-container .btn-custom:focus-visible {
    box-shadow: 0 0 0 4px rgba(109, 92, 174, 0.4);
  }
  
  /* Mobile responsive adjustments */
  @media (max-width: 576px) {
    .styled-form-container {
      margin-top: 2rem;
      padding: 1.5rem;
    }
  }
  
  @keyframes button-loading-spinner {
    from {
      transform: rotate(0turn);
    }
    to {
      transform: rotate(1turn);
    }
  }
