/* ================================
   SEARCH RESULTS PAGE STYLES
   Olana - Match Search & Results
   ================================ */

/* Mobile overflow prevention */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Ensure all elements respect box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Search Container - Simplified */
.search-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid #e0e0e0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.search-container h3 {
    color: #000000;
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
}

/* Form Layout */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.search-form input {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

.search-form input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.search-form input::placeholder {
    color: #999;
}

.search-form small {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 6px;
    line-height: 1.4;
}

.search-form button {
    padding: 12px 24px;
    background: #000000;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4);
    align-self: flex-start;
    box-sizing: border-box;
}

.search-form button:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 3px 6px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.search-form button:active {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
}

/* Results Summary */
.results-summary {
    background: white;
    color: #000000;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.results-summary h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    color: #000000;
}

.results-summary p {
    color: #666;
}

.results-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stat-box {
    background: #ff9800;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffffff;
}

.stat-label {
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    color: #000000;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

/* Match Card (Horizontal Layout) */
.match-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Pet Info Card (inside search container - no shadow/border) */
.search-container .match-card {
    box-shadow: none;
    border: none;
    padding: 0;
    margin-bottom: 0;
}

/* Card Top Section (Photo + Info) */
.card-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Left: Photo Section */
.card-photo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.primary-photo {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}

.thumbnail-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.thumbnail {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail:hover {
    border-color: #000000;
}

/* Right: Info Section */
.card-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Info Items */
.info-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-icon {
    font-size: 18px;
    min-width: 20px;
}

.info-content {
    flex: 1;
}

.info-content strong {
    display: block;
    color: #666;
    font-size: 11px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-content span {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Contact Message (Full Width Below) */
.contact-message {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #ff9800;
}

.contact-message strong {
    display: block;
    color: #000000;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.contact-message p {
    margin: 0;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Collapsible Section */
.collapsible-section {
    margin-top: 30px;
}

.collapsible-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
}

.collapsible-header:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

.collapsible-header:active {
    transform: translateY(0);
}

.collapsible-header h3 {
    margin: 0;
    color: #000000;
    font-weight: 600;
    font-size: 20px;
}

.collapsible-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
    color: #666;
}

.collapsible-icon.open {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.open {
    max-height: 10000px;
    margin-top: 20px;
}

/* Donation Section */
.donation-section {
    background-image: url('/static/img/info_system3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #333;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    position: relative;
}

.donation-section h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    color: #ff9800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.donation-section p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.donation-section ul {
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.donation-section li {
    color: #ffffff;
}

.donation-section strong {
    color: #ff9800;
}

.yape-info {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.yape-info strong {
    font-size: 18px;
    color: #ff9800 !important;
}

.yape-info p {
    margin: 0;
    font-size: 14px;
    color: #ffffff;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 2px solid #e0e0e0;
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #000000;
    margin-bottom: 15px;
    font-weight: 600;
}

.no-results p {
    color: #666;
    line-height: 1.6;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Desktop optimization (>=600px) */
@media (min-width: 600px) {
    .search-form {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 12px;
        align-items: end;
    }

    .search-form .input-wrapper {
        grid-column: 1 / 2;
    }

    .search-form button {
        grid-column: 2 / 3;
        margin-bottom: 0;
        height: fit-content;
    }
}

/* Tablets and mobile (max 768px) */
@media (max-width: 768px) {
    .card-body {
        grid-template-columns: 1fr;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .results-summary-stats {
        grid-template-columns: 1fr;
    }

    .stat-box {
        padding: 15px;
    }

    .stat-number {
        font-size: 28px;
    }
}

/* Small mobile (max 599px) */
@media (max-width: 599px) {
    .search-container {
        padding: 20px;
    }

    .search-form button {
        width: 100%;
    }

    .match-card {
        padding: 15px;
    }

    .results-summary {
        padding: 20px;
    }

    .donation-section {
        padding: 20px;
    }

    .no-results {
        padding: 40px 15px;
    }

    .no-results-icon {
        font-size: 60px;
    }
}

/* Extra small mobile (max 480px) */
@media (max-width: 480px) {
    .search-container {
        padding: 15px;
        margin-bottom: 30px;
    }

    .search-container h3 {
        font-size: 18px;
    }

    .search-form input {
        font-size: 14px;
        padding: 10px 14px;
    }

    .search-form button {
        font-size: 14px;
        padding: 10px 20px;
    }

    .results-summary h2 {
        font-size: 20px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 13px;
    }

    .match-card {
        padding: 12px;
    }

    .card-photo {
        gap: 6px;
    }

    .primary-photo {
        height: 220px;
    }

    .thumbnail {
        height: 50px;
    }

    .info-item {
        padding: 8px;
    }

    .info-icon {
        font-size: 16px;
    }

    .info-content strong {
        font-size: 10px;
    }

    .info-content span {
        font-size: 13px;
    }

    .contact-message {
        padding: 12px;
    }

    .contact-message strong {
        font-size: 13px;
    }

    .collapsible-header {
        padding: 15px;
    }

    .collapsible-header h3 {
        font-size: 18px;
    }

    .donation-section {
        padding: 18px;
    }

    .donation-section h3 {
        font-size: 20px;
    }

    .yape-info {
        padding: 15px;
    }

    .yape-info strong {
        font-size: 16px;
    }
}

/* ================================
   UTILITY CLASSES (to replace inline styles)
   ================================ */

/* Hidden elements */
.hidden {
    display: none;
}

/* Spacing utilities */
.mt-20 {
    margin-top: 20px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-40 {
    margin-bottom: 40px;
}

/* Pet info card styling */
.pet-info-card-container {
    margin-top: 20px;
}

/* Section spacing */
.section-spaced {
    margin-bottom: 40px;
}

/* Donation section default display */
.donation-section {
    margin-top: 40px;
    display: block;
}

/* Donation list styling */
.donation-list {
    margin: 10px 0;
    padding-left: 20px;
    line-height: 1.6;
}

/* Yape info styles */
.yape-info strong {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.yape-info p {
    margin: 0;
    font-size: 14px;
}

/* No results important text */
.no-results-important {
    margin-top: 20px;
    color: #000000;
    font-weight: 600;
}

/* Loading title */
.loading-title {
    color: #000000;
    font-weight: 600;
}

/* Loading text */
.loading-text {
    color: #666;
}

/* Info message in results */
.info-message {
    color: #666;
    text-align: center;
    padding: 20px;
}

/* Section title with icon */
.section-title-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-icon {
    height: 24px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .section-title-icon {
        height: 20px;
    }
}

@media (max-width: 480px) {
    .section-title-icon {
        height: 18px;
    }
}

/* ========== FOOTER TRANSITION ========== */

.footer-transition {
    width: 100%;
    height: 80px;
    background: linear-gradient(
        to bottom,
        #f5f5f5 0%,
        #d0d0d0 25%,
        #999999 50%,
        #4d4d4d 75%,
        #000000 100%
    );
    margin-top: 50px;
}

/* ========== FOOTER STYLES ========== */

.site-footer {
    background: #000000;
    color: #ffffff;
    padding: 30px 40px 20px;
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-logo-image {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.footer-social {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    background: rgba(255, 152, 0, 0.1);
    border: 2px solid #ff9800;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #ff9800;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.social-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.footer-copyright {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.footer-copyright p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* Footer responsive */
@media (max-width: 768px) {
    .footer-transition {
        height: 60px;
        margin-top: 40px;
    }

    .site-footer {
        padding: 25px 30px 15px;
    }

    .footer-content {
        gap: 15px;
    }

    .footer-logo-image {
        height: 50px;
    }

    .footer-social {
        gap: 15px;
        flex-direction: column;
        width: 100%;
    }

    .social-link {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        font-size: 13px;
        padding: 8px 18px;
    }

    .footer-copyright {
        padding-top: 12px;
    }

    .footer-copyright p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .footer-transition {
        height: 50px;
        margin-top: 30px;
    }

    .site-footer {
        padding: 20px 20px 15px;
    }

    .footer-content {
        gap: 12px;
    }

    .footer-logo-image {
        height: 45px;
    }

    .footer-social {
        gap: 12px;
    }

    .social-link {
        font-size: 13px;
        padding: 8px 16px;
    }

    .social-link svg {
        width: 18px;
        height: 18px;
    }

    .footer-copyright {
        padding-top: 10px;
    }

    .footer-copyright p {
        font-size: 11px;
    }
}

/* Download button in no-results */
.no-results-download {
    margin-top: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
}

.no-results-download .btn-download-state {
    padding: 12px 24px;
    font-size: 15px;
    max-width: 220px;
}

.btn-download-state:disabled {
    opacity: 0.7;
    cursor: wait;
}
