/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== BASE ==================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(to bottom, #fef5f1 0%, #fff 100%);
    min-height: 100vh;
    padding: clamp(10px, 3vw, 20px);
    color: #2d2d2d;
    font-size: clamp(14px, 2.5vw, 16px);
}

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

/* ==================== HEADER ==================== */
header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    text-decoration: none;
    color: inherit;
}

.paw-icon {
    font-size: clamp(40px, 8vw, 60px);
    line-height: 1;
}

h1 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 700;
    color: #2d2d2d;
    letter-spacing: -1px;
}

.tagline {
    font-size: clamp(14px, 3vw, 18px);
    color: #666;
    font-weight: 400;
    margin-top: 10px;
    padding: 0 10px;
}

/* ==================== CARD GRID ==================== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: clamp(20px, 4vw, 30px);
    margin-bottom: 40px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-title {
    color: #2d2d2d;
    margin-bottom: 10px;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
}

.card-subtitle {
    color: #666;
    margin-bottom: 25px;
}

h2 {
    color: #FF9F66;
    margin-bottom: 25px;
    font-size: 26px;
    font-weight: 600;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d2d2d;
}

.form-hint {
    color: #999;
    font-size: small;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fafafa;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #FF9F66;
    background: white;
}

.form-textarea {
    resize: vertical;
}

/* Generic input styles */
input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: #fafafa;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #FF9F66;
    background: white;
}

input[type="file"] {
    display: none;
}

/* ==================== UPLOAD AREA ==================== */
.upload-area {
    border: 2px dashed #FF9F66;
    border-radius: 16px;
    padding: clamp(20px, 5vw, 50px) clamp(15px, 4vw, 30px);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    margin-bottom: 25px;
    background: #fff9f5;
    min-height: 120px;
}

.upload-area:hover {
    background: #fff4ed;
    border-color: #ff8844;
    transform: scale(1.02);
}

.upload-area.dragover {
    background: #ffebdd;
    border-color: #ff8844;
    transform: scale(1.05);
}

.upload-area p {
    color: #666;
    font-size: 16px;
}

.upload-label {
    display: block;
    border: 2px dashed #4A90E2;
    border-radius: 16px;
    padding: clamp(20px, 5vw, 50px) clamp(15px, 4vw, 30px);
    text-align: center;
    background: #f0f6fd;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    margin-bottom: 25px;
    min-height: 120px;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-text {
    font-weight: 600;
    color: #4A90E2;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 13px;
    color: #999;
}

/* Mobile-aware upload text */
.upload-text-desktop {
    display: inline;
}

.upload-text-mobile {
    display: none;
}

/* ==================== PREVIEW ==================== */
.preview {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 15px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-container {
    margin-top: 15px;
    display: none;
}

.preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

/* ==================== BUTTONS ==================== */
.card button {
    width: 100%;
    padding: 16px;
    background: #FF9F66;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 159, 102, 0.3);
    min-height: 48px;
}

.card button:hover {
    background: #ff8844;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 159, 102, 0.4);
}

.card button:active {
    transform: translateY(0);
}

.card button:disabled {
    background: #ddd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.card .submit-btn {
    width: 100%;
    padding: 15px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.card .submit-btn:hover {
    background: #357ABD;
}

.card .submit-btn--report {
    background: #FF9F66;
    box-shadow: 0 4px 12px rgba(255, 159, 102, 0.3);
}

.card .submit-btn--report:hover {
    background: #ff8844;
    box-shadow: 0 6px 20px rgba(255, 159, 102, 0.4);
}

.card .clear-btn {
    width: 100%;
    padding: 15px;
    background: #c5ccd3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.card .clear-btn:hover {
    background: #b0b8c1;
}

.card .location-btn {
    width: 100%;
    padding: 12px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.card .location-btn:hover {
    background: #357ABD;
}

.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    color: #999;
    font-size: 13px;
    font-weight: 500;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

/* ==================== HOLDING PET OPTIONS ==================== */
.holding-options {
    display: flex;
    gap: 15px;
}

.holding-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s;
}

.holding-label input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.holding-label span {
    font-weight: 500;
}

input[type="radio"]:checked+span {
    color: #4A90E2;
    font-weight: 600;
}

input[type="radio"]:checked {
    accent-color: #4A90E2;
}

label:has(input[type="radio"]:checked) {
    border-color: #4A90E2;
    background: #f0f7ff;
}

label:has(input[type="radio"]):hover {
    border-color: #4A90E2;
}

/* ==================== LOADING ==================== */
.loading-container {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.loading-text {
    margin-top: 10px;
    color: #666;
}

/* ==================== MESSAGES ==================== */
.success-msg {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
}

.error-msg {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

.error-message {
    display: none;
}

/* ==================== MATCH RESULTS ==================== */
.match {
    background: linear-gradient(135deg, #fff9f5 0%, #fff 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #FF9F66;
    transition: all 0.3s;
}

.match:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 159, 102, 0.15);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pet-name {
    font-weight: 600;
    font-size: 20px;
    color: #2d2d2d;
}

.similarity {
    background: #FF9F66;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 159, 102, 0.3);
}

.match-details {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

.match-header-title {
    margin-bottom: 20px;
    color: #2d2d2d;
    font-size: 18px;
}

.match-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.match-no-results-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.match-no-results h3 {
    color: #2d2d2d;
    margin-bottom: 10px;
}

.match-no-results p {
    color: #666;
    margin-bottom: 20px;
}

.match-no-results-tips {
    background: white;
    padding: 20px;
    border-radius: 6px;
    text-align: left;
    max-width: 400px;
    margin: 0 auto 25px;
}

.match-no-results-tips p {
    font-weight: 600;
    margin-bottom: 10px;
}

.match-no-results-tips ul {
    color: #666;
    line-height: 1.8;
    padding-left: 20px;
}

.match-card-container {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.match-card-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.match-card-img:hover {
    transform: scale(1.02);
}

.match-card-details {
    flex: 1;
    min-width: 0;
}

.match-card-details p {
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

/* ==================== MATCH CONTACT INFO ==================== */
.match-contact-info {
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 10px;
}

.match-org-info {
    background: linear-gradient(135deg, #f0f7ff, #e8f0fe);
    border: 1px solid #c4d8f0;
}

.match-finder-info {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
}

.match-contact-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.match-contact-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 4px;
}

.match-contact-detail {
    font-size: 14px;
    color: #555;
    margin-bottom: 2px;
}

.match-contact-detail a {
    color: #4A90E2;
    text-decoration: none;
}

.match-contact-detail a:hover {
    text-decoration: underline;
}

.match-action-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.match-action-btn--shelter {
    background: #4A90E2;
    color: white;
}

.match-action-btn--shelter:hover {
    background: #357ABD;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.match-action-btn--finder {
    background: #34a853;
    color: white;
}

.match-action-btn--finder:hover {
    background: #2d9248;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

/* ==================== CLAIM LINK ==================== */
.claim-link {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    font-style: italic;
}

.claim-link:hover {
    color: #D81B60;
    text-decoration: underline;
}

.claim-link--done {
    color: #28a745;
    cursor: default;
    font-style: normal;
}

.claim-link--done:hover {
    color: #28a745;
    text-decoration: none;
}

/* ==================== ALERT FORM ==================== */
.alert-form {
    background: linear-gradient(135deg, #fff5f0, #fff0e6);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #ff6b35;
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.alert-form-header {
    text-align: center;
    margin-bottom: 15px;
}

.alert-form-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.alert-form h4 {
    color: #2d2d2d;
    margin: 0 0 5px 0;
    font-size: 18px;
}

.alert-form-desc {
    color: #666;
    font-size: 13px;
    margin: 0;
}

.alert-form-group {
    margin-bottom: 12px;
}

.alert-form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #2d2d2d;
    font-size: 14px;
}

.alert-form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.alert-form-btn {
    width: 100%;
    padding: 12px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.alert-form-btn:hover {
    background: #e55a2b;
}

.alert-msg {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* ==================== POST-REGISTER FORM ==================== */
.post-register-form {
    margin-top: 10px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.post-register-heading {
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 5px;
    font-size: 16px;
}

/* ==================== FOOTER ==================== */
.footer {
    margin-top: 60px;
    padding: 40px 20px;
    background: #f8f9fa;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
}

.footer-tagline {
    font-size: 18px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 20px;
}

.footer-divider {
    width: 60px;
    height: 2px;
    background: #ff6b35;
    margin: 20px auto;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
}

.footer-link:hover {
    color: #ff6b35;
}

.footer-family {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer-family-label {
    color: #999;
    font-size: 12px;
    text-transform: lowercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.footer-family-links {
    display: flex;
    gap: 20px;
}

.footer-copyright {
    color: #999;
    font-size: 12px;
    margin-top: 30px;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    text-align: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 15px;
}

.modal-message {
    font-size: 16px;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-button {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-button:hover {
    opacity: 0.9;
}

.modal-button-primary {
    background: #D81B60;
    color: white;
}

.modal-button-secondary {
    background: #e0e0e0;
    color: #555;
}

/* ==================== LOADER ==================== */
.paw-loader {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.paw-loader div {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4A90E2;
    animation: pawPrint 1.2s linear infinite;
}

.paw-loader div:nth-child(1) {
    left: 8px;
    animation-delay: 0s;
}

.paw-loader div:nth-child(2) {
    left: 8px;
    animation-delay: -0.4s;
}

.paw-loader div:nth-child(3) {
    left: 32px;
    animation-delay: -0.8s;
}

.paw-loader div:nth-child(4) {
    left: 56px;
    animation-delay: -1.2s;
}

/* ==================== ZOOMABLE IMAGE ==================== */
.zoomable-image {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.zoomable-image:hover {
    transform: scale(1.02);
}



/* ==================== ANIMATIONS ==================== */
@keyframes pawPrint {
    0% {
        top: 8px;
        opacity: 0;
        transform: scale(0.5);
    }

    25% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        top: 35px;
        opacity: 1;
    }

    75% {
        opacity: 0.5;
        transform: scale(0.8);
    }

    100% {
        top: 60px;
        opacity: 0;
        transform: scale(0.3);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}



/* ==================== RESPONSIVE: TABLET (1024px) ==================== */
@media (max-width: 1024px) {
    .cards {
        grid-template-columns: 1fr;
    }
}

/* ==================== RESPONSIVE: MOBILE (768px) ==================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        max-width: 100%;
        width: 100%;
        padding: 15px;
    }

    .card {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 28px;
    }

    h2,
    .card-title {
        font-size: 22px;
    }

    .upload-area {
        padding: 20px;
    }

    .match-card-container {
        flex-direction: column;
    }

    .match-card-img {
        width: 100%;
        max-width: 250px;
        height: auto;
        margin: 0 auto 15px auto;
    }

    .match-action-btn {
        width: 100%;
        text-align: center;
    }

    button {
        width: 100%;
        padding: 14px;
    }

    .holding-options {
        flex-direction: column;
    }

    #matchResults>div>div:first-child {
        flex-direction: column;
    }

    #matchResults img {
        width: 100%;
        max-width: 250px;
        margin: 0 auto 15px auto;
    }

    /* Upload text swap */
    .upload-text-desktop {
        display: none;
    }

    .upload-text-mobile {
        display: inline;
    }

    /* Footer mobile */
    .footer {
        padding: 30px 15px;
    }

    .footer-tagline {
        font-size: 16px;
    }

    .footer-links {
        gap: 15px;
    }

    .footer-family-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==================== RESPONSIVE: SMALL MOBILE (600px) ==================== */
@media (max-width: 600px) {
    .holding-options {
        flex-direction: column;
        gap: 10px;
    }

    .alert-form {
        padding: 20px 15px;
    }
}

/* ==================== RESPONSIVE: TINY (375px) ==================== */
@media (max-width: 375px) {
    body {
        padding: 8px;
        font-size: 14px;
    }

    .card {
        padding: 15px;
    }

    h1 {
        font-size: 28px;
    }

    h2,
    .card-title {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }
}