/* Animal Test Specific Styles */

.test-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0;
}

.preview-container {
    width: 300px;
    height: 300px;
    border-radius: 16px;
    border: 3px dashed var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: var(--background-color);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.preview-container.has-image {
    border-style: solid;
    border-color: var(--primary-color);
}

.placeholder {
    text-align: center;
    color: var(--text-light);
}

.placeholder-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.placeholder p {
    font-size: 14px;
    margin: 0;
    padding: 0 20px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.button-group {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 8px var(--shadow-strong);
}

.action-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.action-btn:active {
    transform: translateY(1px);
}

.upload-btn {
    background-color: var(--primary-color);
    color: #fff;
    display: inline-block;
    text-align: center;
}

.webcam-btn {
    background-color: var(--secondary-color);
    color: #fff;
}

.capture-btn {
    background-color: #e74c3c;
    color: #fff;
    width: 100%;
    max-width: 300px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 8px var(--shadow-strong); }
    50% { box-shadow: 0 4px 20px rgba(231, 76, 60, 0.5); }
}

.analyze-btn {
    background-color: #27ae60;
    color: #fff;
    width: 100%;
    max-width: 300px;
    font-size: 18px;
}

.retry-btn {
    background-color: var(--secondary-color);
    color: #fff;
    margin-top: 20px;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-light);
    font-size: 16px;
}

/* Result */
.result-area {
    margin-top: 20px;
}

.result-card {
    text-align: center;
    padding: 10px 0;
}

.result-emoji {
    font-size: 80px;
    margin-bottom: 10px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.result-title {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 24px;
    border: none;
    padding: 0;
    text-align: center;
}

.result-bars {
    max-width: 400px;
    margin: 0 auto 24px;
}

.bar-group {
    margin-bottom: 16px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: bold;
}

.bar-track {
    height: 24px;
    background-color: var(--background-color);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1s ease;
    width: 0;
}

.dog-bar {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.cat-bar {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.result-description {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* Mobile */
@media (max-width: 600px) {
    .preview-container {
        width: 260px;
        height: 260px;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
        max-width: 260px;
    }

    .action-btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .result-emoji {
        font-size: 60px;
    }

    .result-title {
        font-size: 24px;
    }
}
