/* General Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right, #f0f4f8, #e2e8f0);
  padding: 0;
  margin: 0;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #1e3a8a; /* Darker blue header */
  color: white;
}

header h1 {
  font-size: 2.2rem;
  margin: 0;
}

h2 {
  color: #1f2937;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  margin-top: 0; /* Remove default top margin */
  margin-bottom: 20px;
}

/* Card Styles */
.card {
  background: white;
  padding: 20px; /* Increased padding */
  margin-bottom: 20px; /* Consistent margin */
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); /* Slightly deeper shadow */
  position: relative;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-3px); /* Subtle lift effect */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Profile Card Specifics */
.profile-card .card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.profile-card .action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.profile-card .delete-btn {
    color: #dc3545; /* Bootstrap danger red */
}
.profile-card .delete-btn:hover {
    background-color: #fbebeb;
}

.profile-card .export-btn {
    color: #28a745; /* Bootstrap success green */
    font-size: 18px; /* Slightly smaller than delete */
}
.profile-card .export-btn:hover {
     background-color: #eaf6ec;
}


.profile-card .image-preview {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  gap: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.profile-card .image-preview img {
  width: 70px; /* Slightly smaller images */
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  background-color: #f8f9fa; /* Placeholder background */
}
.profile-card .image-preview span { /* Style for text placeholders */
    display: inline-block;
    width: 70px;
    height: 70px;
    line-height: 70px;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    background-color: #e9ecef;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}


.profile-card strong {
    font-size: 1.2rem;
    color: #1e3a8a;
    display: block;
    margin-bottom: 5px;
}

.profile-card .profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive grid */
    gap: 8px 16px; /* Row and column gap */
    font-size: 0.9rem; /* Slightly smaller text */
}

.profile-card .profile-details span {
    color: #555;
    line-height: 1.5;
}

.profile-card .profile-details span strong { /* Label styling */
    color: #333;
    font-weight: 600;
    font-size: 0.9rem; /* Match text size */
    display: inline; /* Keep label inline */
    margin-bottom: 0;
}

/* Form Styles */
.form-section {
    margin-bottom: 30px; /* Space below form */
}

label {
  display: block;
  font-size: 0.9rem; /* Slightly smaller labels */
  margin-bottom: 4px; /* Space below label */
  margin-top: 12px; /* Space above label */
  color: #4a5568; /* Subdued color */
  font-weight: 600;
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="url"],
textarea {
  padding: 10px; /* More padding */
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box; /* Include padding in width */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

textarea {
    min-height: 80px; /* Minimum height */
    resize: vertical; /* Allow vertical resize only */
}

input[type="file"] {
    padding: 5px; /* Adjust padding for file input */
    font-size: 0.9rem;
    border: none; /* Remove border for cleaner look */
}

.file-inputs {
    margin-top: 15px;
    gap: 15px; /* Space between file inputs */
    align-items: flex-start; /* Align items top */
}
.file-inputs > div {
    flex: 1; /* Allow inputs to share space */
}

button.submit-btn {
  margin-top: 20px; /* More space above button */
  padding: 12px 20px; /* Larger button */
  border: none;
  background: #2563eb;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.3s ease;
  width: auto; /* Don't force full width */
  display: block; /* Center easily if needed */
  margin-left: auto;
  margin-right: auto;
}

button.submit-btn:hover {
  background: #1e40af; /* Darker blue on hover */
}

/* Layout Helpers */
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px; /* Consistent gap */
  margin-bottom: 10px; /* Space between rows */
}

.half-width {
  flex: 1 1 calc(50% - 16px); /* Default half width */
  min-width: 200px; /* Prevent extreme squishing */
}
.full-width {
  flex: 1 1 100%;
}

/* Search Box */
#searchBox {
  width: 100%;
  padding: 12px;
  margin-bottom: 25px;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Profiles Container */
#profilesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid layout */
    gap: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .profile-card .profile-details {
        grid-template-columns: 1fr; /* Stack details on smaller screens */
    }
}

@media (max-width: 600px) {
  .half-width {
    flex: 1 1 100%; /* Stack form fields on small screens */
  }
   header h1 {
     font-size: 1.8rem;
   }
   .card {
     padding: 15px;
   }
   button.submit-btn {
       width: 100%; /* Full width button on small screens */
   }
   #profilesContainer {
       grid-template-columns: 1fr; /* Single column layout for profiles */
   }
}