/* ===== Page Styles (Note & Product) ===== */

/* ===== Header styles moved to common.css ===== */

/* Main */
.main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 24px 60px;
}

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

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
}

/* Input Section */
.input-section {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.url-input {
    width: 100%;
    padding: 16px 48px 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.url-input:focus {
    outline: none;
    border-color: var(--accent);
}

.url-input::placeholder {
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    color: var(--text-primary);
}

.clear-btn svg {
    width: 100%;
    height: 100%;
}

.extract-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.extract-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 36, 66, 0.4);
}

.extract-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: var(--error);
    margin-bottom: 24px;
}

/* Result Section */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Product Card */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.product-header {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.product-main-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.product-price {
    margin-bottom: 16px;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.product-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.product-desc {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-primary);
}

/* AI Button */
.ai-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.ai-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.ai-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ai-btn svg {
    width: 16px;
    height: 16px;
}

.ai-btn-loading {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Images Card */
.images-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.image-count {
    font-weight: 400;
    color: var(--text-muted);
}

.download-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.download-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 36, 66, 0.4);
}

.download-all-btn svg {
    width: 16px;
    height: 16px;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.detail-grid {
    grid-template-columns: repeat(3, 1fr);
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-input);
}

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

.image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.image-download-btn {
    padding: 8px 16px;
    background: white;
    border: none;
    border-radius: var(--radius);
    color: #333;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.image-download-btn:hover {
    background: #f0f0f0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
        flex-wrap: nowrap;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-top: 12px;
        gap: 16px;
        justify-content: center;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .main {
        padding: 100px 16px 100px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .input-section {
        flex-direction: column;
    }

    .extract-btn {
        width: 100%;
    }

    .product-header {
        flex-direction: column;
    }

    .product-main-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ai-quota {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .auth-buttons .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
/* Locked Overlay */
.detail-grid.locked {
    display: flex;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.locked-overlay {
    text-align: center;
    padding: 40px;
}

.locked-icon {
    font-size: 48px;
    margin-bottom: 24px;
}

.locked-content h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.locked-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.download-all-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--text-muted);
}
