:root {
    --bg-gradient: linear-gradient(135deg, #fff5f0 0%, #ffe4e1 100%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-primary: #4a3b3b;
    --text-secondary: #8a7575;
    --accent: #ff6b6b;
    --accent-hover: #ff8787;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 85%;
    max-width: 1000px;
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.05), 0 1px 3px rgba(0,0,0,0.05);
}

h1 {
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 0.5px;
    color: #2c1a1a;
}

.app-logo {
    height: 120px;
    width: auto;
    display: block;
    margin: 0 auto 50px auto;
}

.search-bars {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.input-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

select, button {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

button {
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
    border: none;
    padding: 0 32px;
    height: 52px; /* Align with selects */
    align-self: flex-end;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.2);
}

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

.dog-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-radius: 18px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    cursor: pointer;
}

.dog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
}

.dog-card h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c1a1a;
}

.dog-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.dog-card .description,
.perfect-match-card .description {
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dog-card .tag {
    display: inline-block;
    background: rgba(255, 107, 107, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
}

.placeholder-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px 0;
    min-height: 1.5em;
}

.dots {
    display: inline-block;
    width: 1.5em;
    text-align: left;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 10px 20px;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.2);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

.search-section {
    margin-bottom: 30px;
}

textarea {
    width: 100%;
    min-height: 120px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    resize: vertical;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    box-sizing: border-box;
    text-align: center;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.toggle-link {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

.toggle-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.toggle-link a:hover {
    text-decoration: underline;
}

#ai-search-button {
    display: block;
    margin: 20px auto 0;
}

/* Card Image Styles */
.dog-card {
    padding: 0; /* Remove padding to let image bleed to edges */
    overflow: hidden;
}

.dog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dog-card .card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Perfect Match Section */
#perfect-match-container {
    margin-bottom: 40px;
    width: 100%;
}

.perfect-match-header {
    text-align: center;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.perfect-match-card {
    background: #ffffff;
    border: 2px solid var(--accent);
    border-radius: 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(255, 107, 107, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
}

.perfect-match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.2);
}

.perfect-match-card img {
    width: 40%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-left: 20px;
}

.perfect-match-card .card-content {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.perfect-match-card p {
    margin: 0;
}

.animal-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #ffffff;
    border-radius: 24px;
    width: 80%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent);
}

.modal-body {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.carousel {
    flex: 1;
    min-width: 300px;
    position: relative;
    align-self: flex-start;
}

.description-text {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 7.5em; /* Approx 5 lines */
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}


.description-container .read-more-btn {
    display: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: bold;
    margin-top: 5px;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    pointer-events: auto;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.carousel-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.prev-btn {
    margin-left: 10px;
}

.next-btn {
    margin-right: 10px;
}

.carousel img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
}

.modal-info {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-info p {
    margin: 0;
}

#modal-desc p {
    margin-bottom: 10px;
}

#modal-desc p:last-child {
    margin-bottom: 0;
}

#adopt-button {
    margin-top: auto;
    width: 100%;
}

/* Mobile Optimization */
@media (max-width: 600px) {
    .glass-container {
        padding: 20px;
        width: calc(100% - 40px);
        margin: 10px 20px;
        box-sizing: border-box;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .perfect-match-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .perfect-match-card img {
        width: 100%;
        height: 200px;
        margin-left: 0;
        border-radius: 12px 12px 0 0;
    }
    
    .animal-name {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .app-logo {
        height: auto;
        max-width: 90%;
        margin-bottom: 30px;
    }
    
    .search-bars {
        flex-direction: column;
        gap: 15px;
    }
    
    .input-group {
        width: 100%;
    }
    
    button {
        width: 100%;
        align-self: stretch;
    }
}

/* Developer Options Card */
.dev-options-card {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 15px;
    z-index: 2000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    max-width: 250px;
}

.dev-options-card.collapsed {
    padding: 5px;
    background: rgba(255, 255, 255, 0.9);
}

#dev-options-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 5px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    align-self: auto;
}

.dev-options-card.collapsed .dev-options-content {
    display: none;
}

.dev-options-content {
    margin-top: 10px;
}

.dev-options-content .input-group {
    min-width: auto;
}

.btn-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-left: 5px;
    border-radius: 50%;
}
