:root {
   --apple-white: #ffffff;
   --apple-light-gray: #f5f5f7;
   --apple-medium-gray: #d2d2d7;
   --apple-dark-gray: #86868b;
   --apple-text: #1d1d1f;
   --apple-blue: #0066cc;
}

body {
   font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
   background-color: var(--apple-white);
   color: var(--apple-text);
   margin: 0;
   padding: 0;
   -webkit-font-smoothing: antialiased;
}

.container {
   max-width: 1200px;
   margin: 0 auto;
   padding: 40px 20px;
}

.header {
   text-align: center;
   margin-bottom: 60px;
}

.back-link {
   display: inline-flex;
   align-items: center;
   color: var(--apple-blue);
   text-decoration: none;
   font-size: 14px;
   margin-bottom: 16px;
}

.back-link:hover {
   text-decoration: underline;
}

.back-link i {
   margin-right: 6px;
   font-size: 12px;
}

h1 {
   font-size: 40px;
   font-weight: 600;
   letter-spacing: -0.015em;
   margin: 0;
}

.company-subtitle {
   color: var(--apple-dark-gray);
   font-size: 17px;
   margin-top: 8px;
}

.grid-view {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
   gap: 30px;
   margin-top: 40px;
}

.listing-card {
   background-color: var(--apple-white);
   border-radius: 18px;
   overflow: hidden;
   box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
   transition: all 0.3s ease;
   display: flex;
   flex-direction: column;
   height: 100%;
}

.listing-card:hover {
   transform: translateY(-6px);
   box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.card-image-container {
   position: relative;
   overflow: hidden;
   background-color: var(--apple-light-gray);
   height: 200px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.card-image {
   /* Changed to prevent stretching while maintaining coverage */
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   width: auto;
   height: auto;
   max-width: 100%;
   max-height: 100%;
   object-fit: contain; /* Changed from 'cover' to 'contain' */
}

.card-placeholder {
   width: 80px;
   height: 80px;
   opacity: 0.3;
}

.card-content {
   padding: 24px;
   flex-grow: 1;
   display: flex;
   flex-direction: column;
}

.card-title {
   font-size: 20px;
   font-weight: 600;
   margin: 0 0 12px 0;
   letter-spacing: -0.01em;
}

.card-description {
   font-size: 15px;
   line-height: 1.5;
   color: var(--apple-dark-gray);
   margin: 0 0 24px 0;
   flex-grow: 1;
}

.view-button {
   display: inline-block;
   background-color: var(--apple-blue);
   color: white;
   font-size: 15px;
   font-weight: 500;
   padding: 12px 20px;
   border-radius: 8px;
   text-decoration: none;
   text-align: center;
   transition: all 0.2s ease;
}

.view-button:hover {
   background-color: #004499;
}

.filter-bar {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding-bottom: 24px;
   border-bottom: 1px solid var(--apple-light-gray);
   margin-bottom: 36px;
}

.search-container {
   flex: 1;
   max-width: 400px;
   position: relative;
}

.search-input {
   width: 100%;
   padding: 12px 20px;
   padding-left: 44px;
   border-radius: 8px;
   border: 1px solid var(--apple-medium-gray);
   font-size: 16px;
   background-color: var(--apple-light-gray);
   transition: all 0.2s ease;
}

.search-input:focus {
   outline: none;
   border-color: var(--apple-blue);
   box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.search-icon {
   position: absolute;
   left: 16px;
   top: 50%;
   transform: translateY(-50%);
   color: var(--apple-dark-gray);
}

.view-options {
   display: flex;
   gap: 12px;
}

.view-option {
   background-color: transparent;
   border: none;
   color: var(--apple-dark-gray);
   font-size: 16px;
   cursor: pointer;
   padding: 8px;
}

.view-option.active {
   color: var(--apple-blue);
}

.empty-state {
   text-align: center;
   padding: 60px 0;
   color: var(--apple-dark-gray);
}

.empty-icon {
   font-size: 48px;
   margin-bottom: 16px;
   opacity: 0.5;
}

@media (max-width: 768px) {
   .grid-view {
       grid-template-columns: 1fr;
   }
   
   .filter-bar {
       flex-direction: column;
       align-items: stretch;
       gap: 16px;
   }
   
   .search-container {
       max-width: none;
   }
}